Skip to content

Commit

Permalink
Ghidra: Update Gradle build file
Browse files Browse the repository at this point in the history
- Support Gradle 8.7
- Latest Ghidra versions add `test/` sub-directories
- Use `toolchain` rule to set language level to Java 17

PiperOrigin-RevId: 636894236
Change-Id: Id8de15a92f55efe8da998dfebb3fc222942827f1
  • Loading branch information
cblichmann authored and copybara-github committed May 24, 2024
1 parent 77e0495 commit 066e5fa
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ apply plugin: 'com.google.protobuf'
apply plugin: 'eclipse'
apply plugin: 'idea'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -61,17 +67,13 @@ protobuf {
}

// Required for IDEs to find the generated sources.
sourceSets {
generated {
java.srcDirs 'build/generated/source/proto/main/java'
}
}
eclipse {
classpath {
file {
whenMerged {
def source = entries.find {
it.path == 'build/generated/source/proto/main/java'
it.path == 'build/generated/source/proto/main/java' ||
it.path == 'build/extracted-include-protos/main'
}
source.entryAttributes['ignore_optional_problems'] = 'true'
}
Expand Down Expand Up @@ -106,5 +108,10 @@ else {
//----------------------END "DO NOT MODIFY" SECTION-------------------------------

// Fix for newer Gradle versions that do not allow undeclared dependencies
tasks.named("extractIncludeProto").configure { dependsOn("copyDependencies") }
tasks.named("extractIncludeProto").configure {
dependsOn("copyDependencies")
}
tasks.named("extractIncludeTestProto").configure {
dependsOn("copyDependencies")
}

0 comments on commit 066e5fa

Please sign in to comment.