Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a module-prefixes field to rename all modules in a pkg #6105

Merged
merged 3 commits into from
May 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update compiler/damlc/daml-opts/daml-opts-types/DA/Daml/Options/Packa…
…ging/Metadata.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
  • Loading branch information
cocreature and hurryabit committed May 28, 2020
commit c205f8c96c2a599d11d3e47b9a489e7af39db294
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ renamingToFlag unitId prefix modules =
ModRenaming
{ modRenamingWithImplicit = False
, modRenamings =
[ ( Ghc.mkModuleName (T.unpack $ LF.moduleNameString m)
, Ghc.mkModuleName (intercalate "." (Ghc.moduleNameString prefix : map T.unpack (LF.unModuleName m))))
[ ( Ghc.mkModuleName s
, Ghc.mkModuleName (Ghc.moduleNameString prefix ++ "." ++ s))
| m <- modules
, s = T.unpack (LF.moduleNameString m)
]
}

Expand Down Expand Up @@ -82,4 +83,3 @@ metadataFile projectRoot =
fromNormalizedFilePath projectRoot </>
projectPackageDatabase </>
"metadata.json"