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

build: update to Gradle 7.0 #1113

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -7,5 +7,5 @@ JDK_MACOS_X64_SHA256="578b17748f5a7d111474bc4c9b5a8a06b4a4aa1ba4a4bc3fef014e079e
JDK_WINDOWS_X64_URL="https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_windows-x64_bin.zip"
JDK_WINDOWS_X64_SHA256="ecbe7f32bc6bff2b6c8e9b68f19cbf4ddf54a492c918ba471f32d645cf1c5cf4"

GRADLE_URL="https://services.gradle.org/distributions/gradle-6.8.3-bin.zip"
GRADLE_SHA256="7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205"
GRADLE_URL="https://services.gradle.org/distributions/gradle-7.0-bin.zip"
GRADLE_SHA256="eb8b89184261025b0430f5b2233701ff1377f96da1ef5e278af6ae8bac5cc305"
@@ -132,9 +132,9 @@ public void execute(ImageEnvironment env) {
} else {
task.getUrl().set("local");
}
task.getToDir().set(buildDir.resolve("images"));
var toDir = isLocal ? "local" : os + "-" + cpu;
task.getToDir().set(buildDir.resolve("images").resolve(toDir));
task.getOS().set(os);
task.getCPU().set(cpu);
task.getLaunchers().set(env.getLaunchers());
task.getModules().set(env.getModules());
});
@@ -143,9 +143,9 @@ public void execute(ImageEnvironment env) {
project.getTasks().register(launchersTaskName, LaunchersTask.class, (task) -> {
task.getLaunchers().set(env.getLaunchers());
task.getOptions().set(env.getOptions());
task.getToDir().set(buildDir.resolve("launchers"));
task.getOS().set(os);
task.getCPU().set(cpu);
var toDir = isLocal ? "local" : os + "-" + cpu;
task.getToDir().set(buildDir.resolve("launchers").resolve(toDir));
});

var zipTaskName = "bundleZip" + subName;
@@ -166,7 +166,7 @@ public void execute(ImageEnvironment env) {
});
}

var subdir = os + "-" + cpu;
var subdir = isLocal ? "local" : os + "-" + cpu;
task.from(buildDir.resolve("images").resolve(subdir), (s) -> {
s.into("image");
});
@@ -194,7 +194,7 @@ public void execute(ImageEnvironment env) {
});
}

var subdir = os + "-" + cpu;
var subdir = isLocal ? "local" : os + "-" + cpu;
task.from(buildDir.resolve("images").resolve(subdir), (s) -> {
s.into("image");
});
@@ -35,17 +35,15 @@
import java.util.Comparator;

public class LaunchersTask extends DefaultTask {
private final Property<String> os;
private Property<Path> toDir;
private Property<String> os;
private Property<String> cpu;
private MapProperty<String, String> launchers;
private ListProperty<String> options;

@Inject
public LaunchersTask(ObjectFactory factory) {
toDir = factory.property(Path.class);
os = factory.property(String.class);
cpu = factory.property(String.class);
toDir = factory.property(Path.class);
launchers = factory.mapProperty(String.class, String.class);
options = factory.listProperty(String.class);
}
@@ -65,11 +63,6 @@ Property<String> getOS() {
return os;
}

@Input
Property<String> getCPU() {
return cpu;
}

@Input
MapProperty<String, String> getLaunchers() {
return launchers;
@@ -84,7 +77,7 @@ private static void clearDirectory(Path directory) throws IOException {

@TaskAction
void generate() throws IOException {
var dest = toDir.get().resolve(os.get() + "-" + cpu.get());
var dest = toDir.get();
if (Files.isDirectory(dest)) {
clearDirectory(dest);
}
@@ -41,7 +41,6 @@

public class LinkTask extends DefaultTask {
private final Property<String> os;
private final Property<String> cpu;
private final Property<String> url;
private final Property<Path> toDir;
private final MapProperty<String, String> launchers;
@@ -52,7 +51,6 @@ public class LinkTask extends DefaultTask {
@Inject
public LinkTask(ObjectFactory factory) {
os = factory.property(String.class);
cpu = factory.property(String.class);
url = factory.property(String.class);
toDir = factory.property(Path.class);
launchers = factory.mapProperty(String.class, String.class);
@@ -71,11 +69,6 @@ Property<String> getOS() {
return os;
}

@Input
Property<String> getCPU() {
return cpu;
}

@Input
Property<String> getUrl() {
return url;
@@ -154,10 +147,11 @@ void link() throws IOException {
uniqueModules.addAll(modules.get());
var allModules = new ArrayList<>(uniqueModules);

Files.createDirectories(toDir.get());
var dest = toDir.get().resolve(os.get() + "-" + cpu.get());
var dest = toDir.get();
if (Files.exists(dest) && Files.isDirectory(dest)) {
clearDirectory(dest);
} else {
Files.createDirectories(dest);
}

Collections.sort(modulePath);
@@ -182,7 +176,7 @@ void link() throws IOException {
.filter(p -> p.getFileName().toString().equals("java" + ext))
.collect(Collectors.toList());
if (javaLaunchers.size() != 1) {
throw new GradleException("Multiple or no java launchers generated for " + os.get() + "-" + cpu.get() + " image");
throw new GradleException("Multiple or no java launchers generated for " + os.get());
}
var java = javaLaunchers.get(0);
project.exec((spec) -> {
@@ -19,5 +19,5 @@
# or visit www.oracle.com if you need additional information or have any
# questions.

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionSha256Sum=3239b5ed86c3838a37d983ac100573f64c1f3fd8e1eb6c89fa5f9529b5ec091d
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionSha256Sum=eb8b89184261025b0430f5b2233701ff1377f96da1ef5e278af6ae8bac5cc305