Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
name: Build
name: Run Gradle on PRs
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
gradle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- name: Install Ghidra
run: |
curl -L "$GHIDRA_URL" -o ghidra.zip
mkdir ~/ghidra
unzip ghidra.zip -d ~/ghidra
rm ghidra.zip
env:
GHIDRA_URL: https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_11.1_build/ghidra_11.1_PUBLIC_20240607.zip
java-version: '21'
- uses: antoniovazquezblanco/setup-ghidra@v2.0.16
with:
version: '12.0'
- name: Execute Gradle build
run: ./gradlew
env:
GHIDRA_INSTALL_DIR: /home/runner/ghidra/ghidra_11.1_PUBLIC/
run: ./gradlew -PGHIDRA_INSTALL_DIR=${{ env.GHIDRA_INSTALL_DIR }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
30 changes: 14 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ def DISTRIBUTION_DIR = file("dist")
def PATH_IN_ZIP = "${project.name}"

def getGitHash = {
def stdout = new ByteArrayOutputStream()
exec {
return providers.exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}.standardOutput.asText.get().trim()
}

wrapper {
Expand All @@ -55,23 +52,24 @@ repositories {

configurations {
localDeps
implementation.extendsFrom localDeps
}

dependencies {
implementation fileTree(dir: ghidraInstallDir + '/Ghidra/Processors', include: "**/*.jar")
localDeps group: 'org.lz4', name: 'lz4-java', version: '1.5.1'
implementation configurations.localDeps
localDeps 'org.lz4:lz4-java:1.5.1'
}

buildExtension {
baseName "${project.name}-${project.version}-${getGitHash()}-Ghidra_${ghidra_version}".replace(' ', '_')
extension 'zip'
destinationDir DISTRIBUTION_DIR
version ''
archiveBaseName.set("${project.name}-${project.version}-${getGitHash()}-Ghidra_${ghidra_version}".replace(' ', '_'))
archiveExtension.set('zip')
destinationDirectory.set(DISTRIBUTION_DIR)

archiveVersion.set('')

// Make sure that we don't try to copy the same file with the same path into the
// zip (this can happen!)
duplicatesStrategy 'exclude'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

// This filtered property file copy must appear before the general
// copy to ensure that it is prefered over the unmodified file
Expand Down Expand Up @@ -119,13 +117,13 @@ buildExtension {
into PATH_IN_ZIP
}

doLast {
println "\nCreated " + baseName + "." + extension + " in " + destinationDir
doLast {
println "\nCreated " + archiveBaseName.get() + "." + archiveExtension.get() + " in " + destinationDirectory.get().asFile
}
}

tasks.withType(Copy).all { duplicatesStrategy 'exclude' }
tasks.withType(Copy).all { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }

jar {
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.9.1
version=0.9.2
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading