diff --git a/.last-exported-commit b/.last-exported-commit index 3ea478c..2265150 100644 --- a/.last-exported-commit +++ b/.last-exported-commit @@ -1 +1 @@ -Last exported commit from parent repo: b756d20b45f7ae3390d942dcdfef45f2678b8bf6 \ No newline at end of file +Last exported commit from parent repo: 8eae127411b0436d01a8c9a17f0d842078487999 \ No newline at end of file diff --git a/nix-bootstrap.cabal b/nix-bootstrap.cabal index 44d7126..ec6baa9 100644 --- a/nix-bootstrap.cabal +++ b/nix-bootstrap.cabal @@ -5,7 +5,7 @@ cabal-version: 2.0 -- see: https://github.com/sol/hpack name: nix-bootstrap -version: 1.5.1.1 +version: 1.5.2.0 author: gchquser maintainer: 48051938+sd234678@users.noreply.github.com copyright: Crown Copyright diff --git a/package.yaml b/package.yaml index 96853cb..3a74a19 100644 --- a/package.yaml +++ b/package.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. name: nix-bootstrap -version: 1.5.1.1 +version: 1.5.2.0 author: gchquser maintainer: 48051938+sd234678@users.noreply.github.com copyright: Crown Copyright diff --git a/src/Bootstrap/Nix/Expr/MkShell.hs b/src/Bootstrap/Nix/Expr/MkShell.hs index 4ec13df..3257127 100644 --- a/src/Bootstrap/Nix/Expr/MkShell.hs +++ b/src/Bootstrap/Nix/Expr/MkShell.hs @@ -9,7 +9,7 @@ import Bootstrap.Data.PreCommitHook ) import Bootstrap.Data.ProjectType ( HasProjectSuperType (projectSuperType), - ProjectSuperType (PSTRust), + ProjectSuperType (PSTJava, PSTRust), ) import Bootstrap.Nix.Expr ( Binding, @@ -38,11 +38,14 @@ mkShell buildInputSpec@BuildInputSpec {bisPreCommitHooksConfig, bisProjectType} data ShellHook = ShellHookFromPreCommit + | ShellHookJava | ShellHookRust | ShellHookCombined (NonEmpty ShellHook) shellHookFor :: HasProjectSuperType t => PreCommitHooksConfig -> t -> Maybe ShellHook shellHookFor pchc pt = case (pchc, projectSuperType pt) of + (PreCommitHooksConfig True, PSTJava) -> Just $ ShellHookCombined (ShellHookJava :| [ShellHookFromPreCommit]) + (PreCommitHooksConfig False, PSTJava) -> Just ShellHookJava (PreCommitHooksConfig True, PSTRust) -> Just $ ShellHookCombined (ShellHookRust :| [ShellHookFromPreCommit]) (PreCommitHooksConfig False, PSTRust) -> Just ShellHookRust (PreCommitHooksConfig True, _) -> Just ShellHookFromPreCommit @@ -61,5 +64,6 @@ shellHookBinding = \case shellHookComponentBinding :: ShellHook -> [Text] shellHookComponentBinding = \case ShellHookFromPreCommit -> ["${preCommitHooks.allHooks.shellHook}"] + ShellHookJava -> ["export JAVA_HOME=\"${nixpkgs.jdk}\""] ShellHookRust -> ["export RUST_SRC_PATH=${nixpkgs.rustPlatform.rustLibSrc}"] ShellHookCombined xs -> sconcat $ shellHookComponentBinding <$> xs