Skip to content

Commit 939b2c1

Browse files
authoredSep 17, 2024··
[ci] Updates gradle to 8.10.1 (#512)
1 parent bbc4c73 commit 939b2c1

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
 

‎apache-flink/image-classification/src/main/java/com/example/EMI.java

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class EMI {
2727

2828
private static final Logger logger = LoggerFactory.getLogger(EMI.class);
2929

30+
@SuppressWarnings("deprecation")
3031
public static void main(String[] args) throws Exception {
3132
MultipleParameterTool params = MultipleParameterTool.fromArgs(args);
3233
// set up the execution environment

‎gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1.bin.zip

‎huggingface/nlp/build.gradle.kts

+29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@file:Suppress("UNCHECKED_CAST")
22

33
plugins {
4+
`java-library`
45
application
56
}
67
apply(file("../../tools/gradle/javaFormatter.gradle.kts"))
@@ -32,4 +33,32 @@ tasks {
3233
systemProperties = System.getProperties().toMap() as Map<String, Any>
3334
systemProperties.remove("user.dir")
3435
}
36+
37+
sourceSets.main.get().java.files
38+
.filter { it.readText().contains("public static void main(String[] args)") }
39+
.map {
40+
it.path.substringAfter("java${File.separatorChar}").replace(File.separatorChar, '.')
41+
.substringBefore(".java")
42+
}
43+
.forEach { className ->
44+
val taskName = className.substringAfterLast(".")
45+
46+
register<JavaExec>(name = taskName) {
47+
classpath = sourceSets.main.get().runtimeClasspath
48+
mainClass = className
49+
group = "application"
50+
51+
allJvmArgs = allJvmArgs + listOf(
52+
"--add-opens=java.base/java.lang=ALL-UNNAMED",
53+
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
54+
"--add-opens=java.base/java.net=ALL-UNNAMED",
55+
"--add-opens=java.base/java.nio=ALL-UNNAMED",
56+
"--add-opens=java.base/java.time=ALL-UNNAMED",
57+
"--add-opens=java.base/java.util=ALL-UNNAMED",
58+
"--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED",
59+
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
60+
"--add-opens=java.base/sun.util.calendar=ALL-UNNAMED"
61+
)
62+
}
63+
}
3564
}

0 commit comments

Comments
 (0)
Please sign in to comment.