|
|
|
|
@ -43,10 +43,13 @@ public class MultiReleaseJarPluginTests {
@@ -43,10 +43,13 @@ public class MultiReleaseJarPluginTests {
|
|
|
|
|
|
|
|
|
|
private File buildFile; |
|
|
|
|
|
|
|
|
|
private File propertiesFile; |
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
|
void setup(@TempDir File projectDir) { |
|
|
|
|
this.projectDir = projectDir; |
|
|
|
|
this.buildFile = new File(this.projectDir, "build.gradle"); |
|
|
|
|
this.propertiesFile = new File(this.projectDir, "gradle.properties"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -131,6 +134,9 @@ public class MultiReleaseJarPluginTests {
@@ -131,6 +134,9 @@ public class MultiReleaseJarPluginTests {
|
|
|
|
|
} |
|
|
|
|
multiRelease { releaseVersions 17 } |
|
|
|
|
"""); |
|
|
|
|
writeGradleProperties(""" |
|
|
|
|
org.gradle.jvmargs=-Duser.language=en |
|
|
|
|
"""); |
|
|
|
|
writeClass("src/main/java17", "Main.java", """ |
|
|
|
|
public class Main { |
|
|
|
|
|
|
|
|
|
@ -152,6 +158,12 @@ public class MultiReleaseJarPluginTests {
@@ -152,6 +158,12 @@ public class MultiReleaseJarPluginTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void writeGradleProperties(String properties) throws IOException { |
|
|
|
|
try (PrintWriter out = new PrintWriter(new FileWriter(this.propertiesFile))) { |
|
|
|
|
out.print(properties); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void writeClass(String path, String fileName, String fileContent) throws IOException { |
|
|
|
|
Path folder = this.projectDir.toPath().resolve(path); |
|
|
|
|
Files.createDirectories(folder); |
|
|
|
|
|