-
Notifications
You must be signed in to change notification settings - Fork 15
Gradle java 11 #15
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
Merged
cyrille-artho
merged 5 commits into
javapathfinder:master
from
Mahmoud-Khawaja:gradle-java-11
Jun 6, 2025
Merged
Gradle java 11 #15
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9e423e5
added the missing dependenices and supported java 11
Mahmoud-Khawaja efd30d3
Excluded the example Code from compilation
Mahmoud-Khawaja ae8f7cf
fixed the absolute path
Mahmoud-Khawaja d2ddd80
fixed the absolute path
Mahmoud-Khawaja 519ed71
Update build.gradle
Mahmoud-Khawaja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,80 @@ | ||
| apply plugin: "java" | ||
| plugins { | ||
| id 'java' | ||
| id 'maven-publish' | ||
| } | ||
|
|
||
| sourceCompatibility = '1.8' | ||
| targetCompatibility = '1.8' | ||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_11 | ||
| targetCompatibility = JavaVersion.VERSION_11 | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| // jpf-core | ||
| implementation files(jpf.Jar.getFullPath()) | ||
|
|
||
| // JUnit 4 | ||
| testImplementation 'junit:junit:4.12' | ||
| // JGroups (for example/Client.java, SimpleSender.java, SimpleReciever.java) | ||
| implementation 'org.jgroups:jgroups:5.4.4.Final' | ||
|
|
||
| // bcel | ||
| implementation 'org.apache.bcel:bcel:6.5.0' | ||
| // Apache Commons Math3 (for example/CommonMath.java) | ||
| implementation 'org.apache.commons:commons-math3:3.6.1' | ||
|
|
||
| // jars used in the examples | ||
| implementation fileTree(dir: 'lib/example', include: ['*/*.jar']) | ||
| } | ||
| // Google Translate API (for example/GoogleTranslator.java) | ||
| implementation 'com.google.cloud:google-cloud-translate:2.6.0' | ||
|
|
||
| jar { | ||
| archiveBaseName = 'jpf-nhandler' | ||
| exclude('example/**') | ||
| destinationDirectory.set(file("${buildDir}")) | ||
| // BCEL (already present) | ||
| implementation 'org.apache.bcel:bcel:6.7.0' | ||
|
|
||
| // JUnit 5 for tests | ||
| testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' | ||
| testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' | ||
| } | ||
|
|
||
| test { | ||
| testLogging { | ||
| events "passed", "skipped", "failed" | ||
|
|
||
| sourceSets { | ||
| main { | ||
| java { | ||
| srcDirs = ['src/main/java'] | ||
| exclude 'example/**' | ||
| } | ||
| } | ||
| test { | ||
| java { | ||
| srcDirs = ['src/test/java'] | ||
| } | ||
| } | ||
| } | ||
|
|
||
| jvmArgs += ['--add-exports', 'java.base/jdk.internal.misc=ALL-UNNAMED','--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED','--add-opens', | ||
| 'java.base/java.lang=ALL-UNNAMED','--add-opens', 'java.base/java.util=ALL-UNNAMED','--add-opens', 'java.base/java.util.regex=ALL-UNNAMED', | ||
| '--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED'] | ||
|
|
||
| afterSuite { testDescriptor, result -> | ||
| if (!testDescriptor.parent) { | ||
| println "Test Execution: ${result.resultType}" | ||
| tasks.withType(JavaCompile).configureEach { | ||
| options.encoding = 'UTF-8' | ||
| options.compilerArgs += [ | ||
| '--add-exports', 'java.base/jdk.internal.misc=ALL-UNNAMED', | ||
| '--add-opens', 'java.base/java.lang=ALL-UNNAMED', | ||
| '--add-opens', 'java.base/java.util=ALL-UNNAMED', | ||
| '--add-reads', 'java.base=ALL-UNNAMED' | ||
| ] | ||
| } | ||
|
|
||
| def summaryFields = ["${result.testCount} tests", | ||
| "${result.successfulTestCount} passed", | ||
| "${result.failedTestCount} failed", | ||
| "${result.skippedTestCount} skipped"] | ||
| test { | ||
| useJUnitPlatform() | ||
| jvmArgs = [ | ||
| '--add-exports', 'java.base/jdk.internal.misc=ALL-UNNAMED', | ||
| '--add-opens', 'java.base/java.lang=ALL-UNNAMED', | ||
| '--add-opens', 'java.base/java.util=ALL-UNNAMED' | ||
| ] | ||
| } | ||
|
|
||
| println ("Summary: " + summaryFields.join(", ")) | ||
| } | ||
| jar { | ||
| archiveBaseName = 'jpf-nhandler' | ||
| manifest { | ||
| attributes( | ||
| 'Implementation-Title': 'JPF Native Method Handler', | ||
| 'Implementation-Version': '1.0' | ||
| ) | ||
| } | ||
| exclude('example/**') | ||
| } | ||
|
|
||
| defaultTasks "jar" | ||
| defaultTasks 'clean', 'build' | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.