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
47 changes: 14 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- master
paths:
- 'src/**'
- 'fixtures/**'
- 'build.gradle*'
- 'settings.gradle*'
- 'gradle/**'
Expand All @@ -16,6 +17,7 @@ on:
pull_request:
paths:
- 'src/**'
- 'fixtures/**'
- 'build.gradle*'
- 'settings.gradle*'
- 'gradle/**'
Expand All @@ -31,11 +33,13 @@ concurrency:

jobs:
test:
name: Download Fixtures And Run Tests
name: Test (${{ matrix.profile }})
runs-on: ubuntu-latest
timeout-minutes: 45
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
profile: [26x, legacy]

steps:
- name: Check out repository
Expand All @@ -52,42 +56,19 @@ jobs:
with:
gradle-version: "9.4.1"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Sync addon source repos
run: python tools/download_latest_release_jars.py --update

- name: Download latest release fixture jars
run: gradle downloadLatestReleaseJars --no-daemon
- name: Run test suite
run: gradle test --no-daemon -PautoGenerateStubs -PparserProfile=${{ matrix.profile }}

- name: Run 26x test suite
run: gradle test --no-daemon -PautoGenerateStubs -PparserProfile=26x

- name: Generate 26x JSON output
- name: Generate JSON output
run: >
gradle run --no-daemon -PparserProfile=26x
--args="--input fixtures/addons/jars --output output/poc-scan --summary output/poc-scan/summary.json --profile 26x"

- name: Upload release summaries
if: always()
uses: actions/upload-artifact@v4
with:
name: release-summaries
if-no-files-found: warn
path: |
ai_reference/addons/clone-summary.json
fixtures/addons/jars/release-summary.json
fixtures/addons/jars/release-summary.csv
fixtures/addons/jars/release-summary.txt
gradle run --no-daemon -PparserProfile=${{ matrix.profile }}
--args="--input fixtures/addons/jars/${{ matrix.profile }} --output output/poc-scan --summary output/poc-scan/summary.json --profile ${{ matrix.profile }}"

- name: Upload test reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports
name: test-reports-${{ matrix.profile }}
if-no-files-found: warn
path: |
build/reports/tests/test/**
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ output/
# Temporary files
tmp/

# AI reference materials
# AI reference materials (kept local; not part of project sources)
ai_reference/

# Mappings
mappings/

# Local fixture jars
fixtures/addons/jars/

# Generated source
src/generated/

Expand Down
26 changes: 8 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'application'
id 'com.diffplug.spotless' version '7.0.2'
id 'com.diffplug.spotless' version '8.4.0'
}

group = 'com.cope.addonparser'
Expand All @@ -20,6 +20,7 @@ if (parserProfile != 'legacy' && parserProfile != '26x') {
throw new GradleException("Unknown parserProfile: ${parserProfile} (expected 'legacy' or '26x')")
}
def profileSourceDir = parserProfile == 'legacy' ? 'src/profile-legacy/java' : 'src/profile-26x/java'
def profileFixtureJarsDir = "fixtures/addons/jars/${parserProfile}"

repositories {
mavenCentral()
Expand All @@ -46,6 +47,7 @@ tasks.withType(Test).configureEach {
useJUnitPlatform()
jvmArgs '-noverify'
systemProperty 'addonparser.profile', parserProfile
systemProperty 'addonparser.fixtureJarsDir', profileFixtureJarsDir
}

application {
Expand Down Expand Up @@ -80,35 +82,21 @@ dependencies {
tasks.register('generateStubs', JavaExec) {
classpath = sourceSets.stubgen.runtimeClasspath
mainClass = 'com.cope.addonparser.tools.StubGenerator'
args '--input-dir', 'fixtures/addons/jars',
args '--input-dir', profileFixtureJarsDir,
'--output-dir', 'src/generated/java',
'--manual-class-list', 'tools/manual_classes.txt',
'--manual-source-dirs', files('src/main/java', profileSourceDir).asPath,
'--profile', parserProfile

// Incremental support: declare inputs and outputs
inputs.dir('fixtures/addons/jars')
inputs.dir(profileFixtureJarsDir)
inputs.file('tools/manual_classes.txt')
inputs.dir('src/main/java')
inputs.dir(profileSourceDir)
inputs.files(sourceSets.stubgen.output)
outputs.dir('src/generated/java')
}

tasks.register('downloadLatestReleaseJars', JavaExec) {
group = 'build setup'
description = 'Downloads latest GitHub release jar assets for repos under ai_reference/addons.'
classpath = sourceSets.stubgen.runtimeClasspath
mainClass = 'com.cope.addonparser.tools.ReleaseJarDownloader'
args '--addons-dir', 'ai_reference/addons',
'--jars-dir', 'fixtures/addons/jars',
'--fail-on-error'

inputs.dir('ai_reference/addons')
outputs.dir('fixtures/addons/jars')
outputs.upToDateWhen { false }
}

tasks.named('compileJava') {
mustRunAfter tasks.named('generateStubs')
}
Expand Down Expand Up @@ -153,11 +141,13 @@ tasks.named('clean') {

// AP-009: Spotless configuration for Google Java Style on manual sources
spotless {
ratchetFrom 'master'

java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java', 'src/stubgen/java/**/*.java',
'src/profile-legacy/java/**/*.java', 'src/profile-26x/java/**/*.java'
targetExclude 'src/generated/java/**'
googleJavaFormat()
googleJavaFormat('1.35.0')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version 1.35.0 for googleJavaFormat appears to be a typo. The latest stable version of google-java-format is currently 1.24.0. Using a non-existent version will cause the build to fail when attempting to resolve the dependency.

        googleJavaFormat('1.24.0')

removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added fixtures/addons/jars/26x/PowHax--powhax-1.6.8.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading