mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
Merge branch 'Gradle-NixOS-IntelliJ' into 'main'
shell.nix: Development shell with dependencies installed See merge request langbeid/powersort!1
This commit is contained in:
commit
44d0fd5fec
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,5 +1,8 @@
|
|||||||
|
/.idea
|
||||||
|
|
||||||
# Ignore Gradle project-specific cache directory
|
# Ignore Gradle project-specific cache directory
|
||||||
.gradle
|
/.gradle
|
||||||
|
|
||||||
# Ignore Gradle build output directory
|
# Ignore Gradle build output directory
|
||||||
build
|
/build
|
||||||
|
/app/build
|
||||||
|
4
.idea/compiler.xml
generated
4
.idea/compiler.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="17" />
|
<bytecodeTargetLevel target="23" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
6
.idea/gradle.xml
generated
6
.idea/gradle.xml
generated
@ -4,8 +4,10 @@
|
|||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
<option name="distributionType" value="LOCAL" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="#JAVA_HOME" />
|
<option name="gradleHome" value="/usr/lib/gradle" />
|
||||||
|
<option name="gradleJvm" value="usr-lib-jdk" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
@ -15,4 +17,4 @@
|
|||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
5
.idea/misc.xml
generated
5
.idea/misc.xml
generated
@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" project-jdk-name="jbr-17" project-jdk-type="JavaSDK" />
|
||||||
</project>
|
</project>
|
||||||
|
19
README.md
19
README.md
@ -4,13 +4,17 @@
|
|||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
Check which Java toolchains can be found by Gradle:
|
Dependencies (JDK23, Gradle, IntelliJ) can be installed by running `nix-shell`.
|
||||||
|
|
||||||
|
**Commandline**
|
||||||
|
|
||||||
|
Check which Java toolchains Gradle finds:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
./gradlew javaToolchains
|
./gradlew javaToolchains
|
||||||
```
|
```
|
||||||
|
|
||||||
This should include version >= 17, e.g.:
|
This should include version >= 23, e.g.:
|
||||||
|
|
||||||
```
|
```
|
||||||
+ N/A JDK 23-ga
|
+ N/A JDK 23-ga
|
||||||
@ -22,6 +26,17 @@ This should include version >= 17, e.g.:
|
|||||||
| Detected by: Current JVM
|
| Detected by: Current JVM
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**IntelliJ**
|
||||||
|
|
||||||
|
When using `nix-shell`, some configuration is necessary:
|
||||||
|
|
||||||
|
- STRG ALT SHIFT s -> SDK -> add JDK ->
|
||||||
|
- home path: /usr/lib/openjdk
|
||||||
|
- name: usr-lib-jdk
|
||||||
|
- STRG ALT s -> build tools -> gradle ->
|
||||||
|
- local installation: /usr/lib/gradle
|
||||||
|
- Gradle JVM: usr-lib-jdk
|
||||||
|
|
||||||
### Tasks
|
### Tasks
|
||||||
|
|
||||||
List all Gradle tasks which can be run:
|
List all Gradle tasks which can be run:
|
||||||
|
@ -28,7 +28,7 @@ dependencies {
|
|||||||
// Apply a specific Java toolchain to ease working on different environments.
|
// Apply a specific Java toolchain to ease working on different environments.
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion = JavaLanguageVersion.of(17)
|
languageVersion = JavaLanguageVersion.of(23)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
27
shell.nix
Normal file
27
shell.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Gradle's toolchain support does not work with IntelliJ, thus we have to use buildFHSUserEnv
|
||||||
|
|
||||||
|
# https://discourse.nixos.org/t/how-to-create-a-development-environment-with-intellij-idea-and-openjdk/10153
|
||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> {
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/166220#issuecomment-1745803058
|
||||||
|
config.allowUnfree = true;
|
||||||
|
}
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
unstable = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz) { };
|
||||||
|
jdk = unstable.jdk23;
|
||||||
|
gradle = unstable.gradle;
|
||||||
|
in
|
||||||
|
|
||||||
|
(
|
||||||
|
pkgs.buildFHSUserEnv
|
||||||
|
{
|
||||||
|
name = "intellij-gradle-jdk23";
|
||||||
|
targetPkgs = pkgs_: [
|
||||||
|
pkgs_.jetbrains.idea-ultimate
|
||||||
|
jdk
|
||||||
|
gradle
|
||||||
|
];
|
||||||
|
}
|
||||||
|
).env
|
Loading…
x
Reference in New Issue
Block a user