Skip to content

Commit

Permalink
Try to get package name from manifest (if not provided) (digital-asse…
Browse files Browse the repository at this point in the history
…t#4476)

Also, mark `build-and-lint` "exclusive".

changelog_begin
changelog_end
  • Loading branch information
shayne-fletcher authored Feb 11, 2020
1 parent 943b430 commit a334e21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions language-support/ts/codegen/src/TsCodeGenMain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ main :: IO ()
main = do
opts@Options{..} <- execParser optionsParserInfo
dar <- B.readFile optInputDar
dalfs <- either fail pure $ DAR.readDalfs $ Zip.toArchive $ BSL.fromStrict dar
forM_ ((DAR.mainDalf dalfs, optMainPackageName) : map (, Nothing) (DAR.dalfs dalfs)) $ \(dalf, mbPkgName) -> do
let archive = Zip.toArchive $ BSL.fromStrict dar
dalfs <- either fail pure $ DAR.readDalfs archive
DAR.DalfManifest{packageName, ..} <- either fail pure $ DAR.readDalfManifest archive
packageName <- pure $ optMainPackageName <|> packageName
forM_ ((DAR.mainDalf dalfs, packageName) : map (, Nothing) (DAR.dalfs dalfs)) $ \(dalf, mbPkgName) -> do
(pkgId, pkg) <- either (fail . show) pure $ Archive.decodeArchive Archive.DecodeAsMain (BSL.toStrict dalf)
daml2ts opts pkgId pkg mbPkgName

Expand Down
3 changes: 3 additions & 0 deletions language-support/ts/codegen/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ sh_test(
"ts/generated/src/daml/**",
],
),
tags = [
"exclusive", # Due to the use of hardcoded ports in 'build-and-lint.sh'.
],
deps = [
"@bazel_tools//tools/bash/runfiles",
],
Expand Down

0 comments on commit a334e21

Please sign in to comment.