Skip to content

Commit 68c3d5a

Browse files
committed
Ensure JAVA_HOME gets set properly
1 parent b596c26 commit 68c3d5a

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.last-exported-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Last exported commit from parent repo: b756d20b45f7ae3390d942dcdfef45f2678b8bf6
1+
Last exported commit from parent repo: 8eae127411b0436d01a8c9a17f0d842078487999

nix-bootstrap.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cabal-version: 2.0
55
-- see: https://github.com/sol/hpack
66

77
name: nix-bootstrap
8-
version: 1.5.1.1
8+
version: 1.5.2.0
99
author: gchquser
1010
maintainer: [email protected]
1111
copyright: Crown Copyright

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
name: nix-bootstrap
15-
version: 1.5.1.1
15+
version: 1.5.2.0
1616
author: gchquser
1717
maintainer: [email protected]
1818
copyright: Crown Copyright

src/Bootstrap/Nix/Expr/MkShell.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Bootstrap.Data.PreCommitHook
99
)
1010
import Bootstrap.Data.ProjectType
1111
( HasProjectSuperType (projectSuperType),
12-
ProjectSuperType (PSTRust),
12+
ProjectSuperType (PSTJava, PSTRust),
1313
)
1414
import Bootstrap.Nix.Expr
1515
( Binding,
@@ -38,11 +38,14 @@ mkShell buildInputSpec@BuildInputSpec {bisPreCommitHooksConfig, bisProjectType}
3838

3939
data ShellHook
4040
= ShellHookFromPreCommit
41+
| ShellHookJava
4142
| ShellHookRust
4243
| ShellHookCombined (NonEmpty ShellHook)
4344

4445
shellHookFor :: HasProjectSuperType t => PreCommitHooksConfig -> t -> Maybe ShellHook
4546
shellHookFor pchc pt = case (pchc, projectSuperType pt) of
47+
(PreCommitHooksConfig True, PSTJava) -> Just $ ShellHookCombined (ShellHookJava :| [ShellHookFromPreCommit])
48+
(PreCommitHooksConfig False, PSTJava) -> Just ShellHookJava
4649
(PreCommitHooksConfig True, PSTRust) -> Just $ ShellHookCombined (ShellHookRust :| [ShellHookFromPreCommit])
4750
(PreCommitHooksConfig False, PSTRust) -> Just ShellHookRust
4851
(PreCommitHooksConfig True, _) -> Just ShellHookFromPreCommit
@@ -61,5 +64,6 @@ shellHookBinding = \case
6164
shellHookComponentBinding :: ShellHook -> [Text]
6265
shellHookComponentBinding = \case
6366
ShellHookFromPreCommit -> ["${preCommitHooks.allHooks.shellHook}"]
67+
ShellHookJava -> ["export JAVA_HOME=\"${nixpkgs.jdk}\""]
6468
ShellHookRust -> ["export RUST_SRC_PATH=${nixpkgs.rustPlatform.rustLibSrc}"]
6569
ShellHookCombined xs -> sconcat $ shellHookComponentBinding <$> xs

0 commit comments

Comments
 (0)