Skip to content

Commit

Permalink
[ci] Updates gradle to 8.10.1 (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Sep 17, 2024
1 parent bbc4c73 commit 939b2c1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class EMI {

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

@SuppressWarnings("deprecation")
public static void main(String[] args) throws Exception {
MultipleParameterTool params = MultipleParameterTool.fromArgs(args);
// set up the execution environment
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1.bin.zip
29 changes: 29 additions & 0 deletions huggingface/nlp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@file:Suppress("UNCHECKED_CAST")

plugins {
`java-library`
application
}
apply(file("../../tools/gradle/javaFormatter.gradle.kts"))
Expand Down Expand Up @@ -32,4 +33,32 @@ tasks {
systemProperties = System.getProperties().toMap() as Map<String, Any>
systemProperties.remove("user.dir")
}

sourceSets.main.get().java.files
.filter { it.readText().contains("public static void main(String[] args)") }
.map {
it.path.substringAfter("java${File.separatorChar}").replace(File.separatorChar, '.')
.substringBefore(".java")
}
.forEach { className ->
val taskName = className.substringAfterLast(".")

register<JavaExec>(name = taskName) {
classpath = sourceSets.main.get().runtimeClasspath
mainClass = className
group = "application"

allJvmArgs = allJvmArgs + listOf(
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens=java.base/java.net=ALL-UNNAMED",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/java.time=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
"--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.base/sun.util.calendar=ALL-UNNAMED"
)
}
}
}

0 comments on commit 939b2c1

Please sign in to comment.