diff --git a/.github/build-scan-init.gradle b/.github/build-scan-init.gradle index 703b825f2..2fda6179a 100644 --- a/.github/build-scan-init.gradle +++ b/.github/build-scan-init.gradle @@ -23,22 +23,11 @@ initscript { def isTopLevelBuild = gradle.getParent() == null if (isTopLevelBuild) { - def gradleVersion = GradleVersion.current().baseVersion - def atLeastGradle5 = gradleVersion >= GradleVersion.version("5.0") - def atLeastGradle6 = gradleVersion >= GradleVersion.version("6.0") - - if (atLeastGradle6) { - settingsEvaluated { - if (!it.pluginManager.hasPlugin("com.gradle.enterprise")) { - it.pluginManager.apply(GradleEnterprisePlugin) - } - configureExtension(it.extensions["gradleEnterprise"]) - } - } else if (atLeastGradle5) { - rootProject { - pluginManager.apply(BuildScanPlugin) - configureExtension(extensions["gradleEnterprise"]) + settingsEvaluated { + if (!it.pluginManager.hasPlugin("com.gradle.enterprise")) { + it.pluginManager.apply(GradleEnterprisePlugin) } + configureExtension(it.extensions["gradleEnterprise"]) } } @@ -46,18 +35,9 @@ void configureExtension(extension) { extension.buildScan.with { termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" - - // - // After the build scan is published, put on STDOUT the special - // GitHub Actions syntax to set an Output Variable for the job - // step: - // - // ::set-output name={variable}::{value} - // - // ref: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter - // + buildScanPublished { PublishedBuildScan scan -> - println "::set-output name=buildScanUri::${scan.buildScanUri}\n" + echo "name=buildScanUri::${scan.buildScanUri}\n" >> $GITHUB_OUTPUT } } } diff --git a/.github/codecov.yml b/.github/codecov.yml index bf2d8a70a..f9fd9f313 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -4,16 +4,16 @@ coverage: status: project: default: - target: auto # auto compares coverage to the previous base commit - threshold: 1% # the leniency in hitting the target - informational: true # makes project checks informational only, not failing + target: auto # auto compares coverage to the previous base commit + threshold: 1% # the leniency in hitting the target + informational: true # makes project checks informational only, not failing patch: default: - informational: true # makes patch checks informational only, not failing + informational: true # makes patch checks informational only, not failing fixes: - - "megameklab/::" # reduce root e.g., "before/path/" => "path/" + - "megameklab/::" # reduce root e.g., "before/path/" => "path/" ignore: - "megamek" @@ -21,4 +21,3 @@ ignore: github_checks: # https://docs.codecov.io/docs/github-checks-beta#disabling-github-checks-patch-annotations-via-yaml annotations: false - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93ff026dd..040263091 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ name: MegaMekLab CI with Gradle # Pull Requests being added/updated against master. on: pull_request: - branches: [ master ] + branches: [master] # Setup the Build Scan "VCS" link for all gradle invocations env: @@ -20,129 +20,119 @@ jobs: ci_cd: runs-on: ${{ matrix.os }} + outputs: + mmRepo: ${{ steps.find_mm.outputs.mmRepo }} + mmBranch: ${{ steps.find_mm.outputs.mmBranch }} + # Run this job once for each combination in the matrix below. strategy: matrix: - os: [ ubuntu-latest ] # For CI/CD running on *nix is sufficient - java-distribution: [ temurin ] - java-version: [ 11, 17 ] + os: [ubuntu-latest] # For CI/CD running on *nix is sufficient + java-distribution: [temurin] + java-version: [17] fail-fast: false steps: - # Checkout the Pull Request source and put it in: ./megameklab - - uses: actions/checkout@v3 - with: - path: megameklab - - # Setup composite build for MegaMekLab - # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MegaMekLab - run: | - echo "includeBuild '../megamek'" >./megameklab/settings_local.gradle - - # Find the repo and branch to use for MM - # - # Output variables: - # - # - mmRepo: The MM repository to use. - # - mmBranch: The MM branch to use. - - name: Find the Right MegaMek Branch - id: find_mm - # Override bash so that it doesn't fail fast (the default) - # if we can't find the branch - shell: bash {0} - # This shell script searches the PR submitter's MM repo for - # a branch that has the same name as the current PR branch. - # If found it sets the `mmRepo` and `mmBranch` step output variables - # to that branch. - run: | - git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }} - if [ "$?" == "0" ] - then - echo "${{ github.event.pull_request.head.repo.owner.html_url }}" | awk -F/ '{print "::set-output name=mmRepo::" $4 "/megamek"}' - echo "::set-output name=mmBranch::${{ github.event.pull_request.head.ref }}" - else - echo "::set-output name=mmRepo::MegaMek/megamek" - echo "::set-output name=mmBranch::master" - fi - exit 0 - - # Checkout the latest MegaMek source and put it in: ./megamek - - name: Checkout MegaMek - uses: actions/checkout@v3 - with: - repository: ${{ steps.find_mm.outputs.mmRepo }} - ref: ${{ steps.find_mm.outputs.mmBranch }} - path: megamek - - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} - - # Make sure we can execute the Gradle wrapper - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: megameklab - run: chmod +x gradlew - if: runner.os != 'Windows' - - # Build the MegaMekLab project - # - # Directory layout: - # /megameklab - # /gradlew - # /megamek - # - # Output Variables: - # - buildScanUri - - name: Build with Gradle - uses: gradle/gradle-build-action@v2 - with: - arguments: build --stacktrace --max-workers=1 --scan - build-root-directory: megameklab - - # If the build step fails, try to upload any test logs in case it was a unit test failure. - # The logs will be relative to the ./megameklab directory. - - name: Upload Test Logs on Failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cd-failure-logs - path: ./megameklab/megameklab/build/reports/ - - # Upload our Code Coverage Reports to CodeCov.io - - name: CodeCov.io Coverage Report - uses: codecov/codecov-action@v3 - with: - directory: ./megameklab/megameklab/build/reports/jacoco/test - fail_ci_if_error: false - verbose: true - - # If we have a buildScanUri comment on the PR - # - # NB: This only works if you're on the main MegaMek\megameklab repo - # for now due to a GitHub Actions limitation. -# CAW: temporarily halted https://github.com/thollander/actions-comment-pull-request/issues/17 -# - name: Comment on PR with Build Scan URI -# uses: thollander/actions-comment-pull-request@master -# if: always() && steps.gradle_build.outputs.buildScanUri != '' -# with: -# message: Build scan available at ${{ steps.gradle_build.outputs.buildScanUri }} -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Put the Windows Release in an artifact - # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. - - name: Upload Windows Release - uses: actions/upload-artifact@v3 - with: - name: mml-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} - path: ./megameklab/megameklab/build/distributions/*.zip - - # Put the non-Windows release in an artifact - - name: Upload Nix/Mac Release - uses: actions/upload-artifact@v3 - with: - name: mml-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} - path: ./megameklab/megameklab/build/distributions/*.tar + # Checkout the Pull Request source and put it in: ./megameklab + - name: Checking out MegaMekLab + uses: actions/checkout@v4 + with: + path: megameklab + + # Setup composite build for MegaMekLab + # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle + - name: Setup Composite Build for MegaMekLab + run: | + echo "includeBuild '../megamek'" >> ./megameklab/settings_local.gradle + + # Find the repo and branch to use for MM + # + # Output variables: + # + # - mmRepo: The MM repository to use. + # - mmBranch: The MM branch to use. + - name: Find the Right MegaMek Branch + id: find_mm + # Override bash so that it doesn't fail fast (the default) if we can't find the branch + shell: bash {0} + # This shell script searches the PR submitter's MM repo for + # a branch that has the same name as the current PR branch. + # If found it sets the `mmRepo` and `mmBranch` step output variables + # to that branch. + run: | + git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }} + if [ "$?" == "0" ] + then + echo "mmRepo=${{ github.event.pull_request.head.repo.owner.login }}/megamek" >> $GITHUB_OUTPUT + echo "mmBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT + else + echo "mmRepo=MegaMek/megamek" >> $GITHUB_OUTPUT + echo "mmBranch=master" >> $GITHUB_OUTPUT + fi + exit 0 + + # Checkout the latest MegaMek source and put it in: ./megamek + - name: Checkout MegaMek + uses: actions/checkout@v4 + with: + repository: ${{ steps.find_mm.outputs.mmRepo }} + ref: ${{ steps.find_mm.outputs.mmBranch }} + path: megamek + + # Setup the requested Java Distribution and Version from the matrix + - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.java-distribution }} + java-version: ${{ matrix.java-version }} + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + working-directory: megameklab + run: ./gradlew build --stacktrace --scan + + # If the build step fails, try to upload any test logs in case it was a unit test failure. + # The logs will be relative to the ./megameklab directory. + - name: Upload Test Logs on Failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: cd-failure-logs + path: ./megameklab/megameklab/build/reports/ + + # Upload our Code Coverage Reports to CodeCov.io + - name: CodeCov.io Coverage Report + uses: codecov/codecov-action@v4 + with: + directory: ./megameklab/megameklab/build/reports/jacoco/test + fail_ci_if_error: false + verbose: true + + # If we have a buildScanUri comment on the PR + # + # NB: This only works if you're on the main MegaMek\megameklab repo + # for now due to a GitHub Actions limitation. + # CAW: temporarily halted https://github.com/thollander/actions-comment-pull-request/issues/17 + # - name: Comment on PR with Build Scan URI + # uses: thollander/actions-comment-pull-request@master + # if: always() && steps.gradle_build.outputs.buildScanUri != '' + # with: + # message: Build scan available at ${{ steps.gradle_build.outputs.buildScanUri }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Put the Windows Release in an artifact + # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. + - name: Upload Windows Release + uses: actions/upload-artifact@v4 + with: + name: mml-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} + path: ./megameklab/megameklab/build/distributions/*.zip + + # Put the non-Windows release in an artifact + - name: Upload Nix/Mac Release + uses: actions/upload-artifact@v4 + with: + name: mml-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} + path: ./megameklab/megameklab/build/distributions/*.tar.gz diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 4009cd523..f3526f882 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -9,7 +9,7 @@ name: MegaMekLab CI with Code Coverage # This Action Definition should be triggered only on pushes to master on: push: - branches: [ master ] + branches: [master] # Setup the Build Scan "VCS" link for all gradle invocations env: @@ -23,71 +23,63 @@ jobs: # Run this job once for each combination in the matrix below. strategy: matrix: - os: [ ubuntu-latest ] # For Code QL running on *nix is sufficient - java-distribution: [ temurin ] - java-version: [ 17 ] + os: [ubuntu-latest] # For Code QL running on *nix is sufficient + java-distribution: [temurin] + java-version: [17] steps: - # Checkout the Pull Request source and put it in: ./megameklab - - uses: actions/checkout@v3 - with: - path: megameklab + # Checkout the Pull Request source and put it in: ./megameklab + - uses: actions/checkout@v4 + with: + path: megameklab - # Setup composite build for MegaMekLab - # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MegaMekLab - run: | - echo "includeBuild '../megamek'" >./megameklab/settings_local.gradle + # Setup composite build for MegaMekLab + # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle + - name: Setup Composite Build for MegaMekLab + run: | + echo "includeBuild '../megamek'" >./megameklab/settings_local.gradle - # Checkout the latest MegaMek source and put it in: ./megamek - - name: Checkout MegaMek - uses: actions/checkout@v3 - with: - repository: MegaMek/megamek - path: megamek + # Checkout the latest MegaMek source and put it in: ./megamek + - name: Checkout MegaMek + uses: actions/checkout@v4 + with: + repository: MegaMek/megamek + path: megamek - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} + # Setup the requested Java Distribution and Version from the matrix + - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.java-distribution }} + java-version: ${{ matrix.java-version }} - # Make sure we can execute the Gradle wrapper - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: megameklab - run: chmod +x gradlew - if: runner.os != 'Windows' + # Make sure we can execute the Gradle wrapper + - name: Grant execute permission for gradlew (*nix or MacOS) + working-directory: megameklab + run: chmod +x gradlew + if: runner.os != 'Windows' - # Build the MegaMekLab project - # - # Directory layout: - # /megameklab - # /gradlew - # /megamek - # - # Output Variables: - # - buildScanUri - - name: Build with Gradle - uses: gradle/gradle-build-action@v2 - with: - arguments: build --stacktrace --max-workers=1 --scan - build-root-directory: megameklab - - # If the build step fails, try to upload any test logs in case it was a unit test failure. - # - # The logs will be relative to the ./megameklab directory. - - name: Upload Test Logs on Failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cd-failure-logs - path: ./megameklab/megameklab/build/reports/ + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - # Upload our Code Coverage Reports to CodeCov.io - - name: CodeCov.io Coverage Report - uses: codecov/codecov-action@v3 - with: - directory: ./megameklab/megameklab/build/reports/jacoco/test - fail_ci_if_error: false - verbose: true + - name: Build with Gradle + working-directory: megameklab + run: ./gradlew build --stacktrace --scan + + # If the build step fails, try to upload any test logs in case it was a unit test failure. + # + # The logs will be relative to the ./megameklab directory. + - name: Upload Test Logs on Failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: cd-failure-logs + path: ./megameklab/megameklab/build/reports/ + + # Upload our Code Coverage Reports to CodeCov.io + - name: CodeCov.io Coverage Report + uses: codecov/codecov-action@v4 + with: + directory: ./megameklab/megameklab/build/reports/jacoco/test + fail_ci_if_error: false + verbose: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e6570a46b..2feb3ff7b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,64 +12,101 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [master] schedule: - - cron: '24 16 * * 4' + - cron: "24 16 * * 4" jobs: analyze: name: Analyze runs-on: ${{ matrix.os }} + outputs: + mmRepo: ${{ steps.find_mm.outputs.mmRepo }} + mmBranch: ${{ steps.find_mm.outputs.mmBranch }} + # Run this job once for each combination in the matrix below. strategy: matrix: - os: [ ubuntu-latest ] # For Code QL running on *nix is sufficient - language: [ 'java' ] - java-distribution: [ temurin ] - java-version: [ 17 ] + os: [ubuntu-latest] # For Code QL running on *nix is sufficient + language: ["java"] + java-distribution: [temurin] + java-version: [17] fail-fast: false steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout MegaMekLab + uses: actions/checkout@v4 + with: + path: megameklab + + # Setup composite build for MegaMekLab + # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle + - name: Setup Composite Build for MegaMekLab + run: | + echo "includeBuild '../megamek'" >> ./megameklab/settings_local.gradle - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} + # Find the repo and branch to use for MM + # + # Output variables: + # + # - mmRepo: The MM repository to use. + # - mmBranch: The MM branch to use. + - name: Find the Right MegaMek Branch + id: find_mm + # Override bash so that it doesn't fail fast (the default) if we can't find the branch + shell: bash {0} + # This shell script searches the PR submitter's MM repo for + # a branch that has the same name as the current PR branch. + # If found it sets the `mmRepo` and `mmBranch` step output variables + # to that branch. + run: | + git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }} + if [ "$?" == "0" ] + then + echo "mmRepo=${{ github.event.pull_request.head.repo.owner.login }}/megamek" >> $GITHUB_OUTPUT + echo "mmBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT + else + echo "mmRepo=MegaMek/megamek" >> $GITHUB_OUTPUT + echo "mmBranch=master" >> $GITHUB_OUTPUT + fi + exit 0 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - queries: +security-and-quality + # Checkout the latest MegaMek source and put it in: ./megamek + - name: Checkout MegaMek + uses: actions/checkout@v4 + with: + repository: ${{ steps.find_mm.outputs.mmRepo }} + ref: ${{ steps.find_mm.outputs.mmBranch }} + path: megamek - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild MegaMekLab - uses: github/codeql-action/autobuild@v2 + # Setup the requested Java Distribution and Version from the matrix + - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.java-distribution }} + java-version: ${{ matrix.java-version }} - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + queries: +security-and-quality - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - #- run: | - # make bootstrap - # make release + - name: Build with Gradle + working-directory: megameklab + run: ./gradlew build --stacktrace --scan - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 1614676cd..ce5312431 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -8,7 +8,7 @@ on: schedule: # Nightly at Midnight (UTC) # ref: https://crontab.guru/every-night - - cron: '0 0 * * *' + - cron: "0 0 * * *" # Setup the Build Scan "VCS" link for all gradle invocations env: @@ -21,75 +21,75 @@ jobs: # Run this job once for each combination in the matrix below. strategy: matrix: - os: [ ubuntu-latest, windows-latest ] - java-distribution: [ temurin ] - java-version: [ 11, 17 ] + os: [ubuntu-latest, windows-latest] + java-distribution: [temurin] + java-version: [17] fail-fast: false name: Nightly MegaMekLab CI ${{ matrix.os }} on ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} steps: - # Checkout the latest source and put it in: ./megameklab - - uses: actions/checkout@v3 - with: - path: megameklab + # Checkout the latest source and put it in: ./megameklab + - uses: actions/checkout@v4 + with: + path: megameklab - # Setup composite build for MegaMekLab - # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MegaMekLab - run: | - echo "includeBuild '../megamek'" >./megameklab/settings_local.gradle + # Setup composite build for MegaMekLab + # See: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle + - name: Setup Composite Build for MegaMekLab + run: | + echo "includeBuild '../megamek'" >./megameklab/settings_local.gradle - # Checkout the latest MegaMek source and put it in: ./megamek - - name: Checkout MegaMek - uses: actions/checkout@v3 - with: - repository: MegaMek/megamek - path: megamek + # Checkout the latest MegaMek source and put it in: ./megamek + - name: Checkout MegaMek + uses: actions/checkout@v4 + with: + repository: MegaMek/megamek + path: megamek - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} + # Setup the requested Java Distribution and Version from the matrix + - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.java-distribution }} + java-version: ${{ matrix.java-version }} - # Don't run this for Windows. - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: megameklab - run: chmod +x gradlew - if: runner.os != 'Windows' + # Don't run this for Windows. + - name: Grant execute permission for gradlew (*nix or MacOS) + working-directory: megameklab + run: chmod +x gradlew + if: runner.os != 'Windows' - # Include --stacktrace to make some build failures easier to figure out. - - name: Build with Gradle - uses: gradle/gradle-build-action@v2 - with: - arguments: clean build -x test --continue --stacktrace --max-workers=1 --scan - build-root-directory: megameklab + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - - name: Upload Test Logs on Failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: ${{ matrix.os }}-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}-ci-failure-logs - path: megameklab/megameklab/build/reports/ + - name: Build with Gradle + working-directory: megameklab + run: ./gradlew clean build -x test --continue --stacktrace --scan - # Put the non-Windows Release in an artifact - # - # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. - - name: Upload Nix/Mac Releases - uses: actions/upload-artifact@v3 - if: always() && matrix.os == 'ubuntu-latest' - with: - name: mml-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} - path: megameklab/megameklab/build/distributions/*.tar + - name: Upload Test Logs on Failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: ${{ matrix.os }}-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}-ci-failure-logs + path: megameklab/megameklab/build/reports/ - # Put the Windows Release in an artifact - # - # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. - - name: Upload Windows Release - uses: actions/upload-artifact@v3 - if: always() && matrix.os == 'windows-latest' - with: - name: mml-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} - path: megameklab/megameklab/build/distributions/*.zip + # Put the non-Windows Release in an artifact + # + # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. + - name: Upload Nix/Mac Releases + uses: actions/upload-artifact@v4 + if: always() && matrix.os == 'ubuntu-latest' + with: + name: mml-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} + path: megameklab/megameklab/build/distributions/*.tar.gz + + # Put the Windows Release in an artifact + # + # NB: Due to a GitHub Actions limitation we won't know what the filename is in order to display it somewhere. + - name: Upload Windows Release + uses: actions/upload-artifact@v4 + if: always() && matrix.os == 'windows-latest' + with: + name: mml-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }} + path: megameklab/megameklab/build/distributions/*.zip diff --git a/.github/workflows/nightly-maven-ci.yml b/.github/workflows/nightly-maven-ci.yml index 980b9c918..e6ca410cd 100644 --- a/.github/workflows/nightly-maven-ci.yml +++ b/.github/workflows/nightly-maven-ci.yml @@ -8,7 +8,7 @@ on: schedule: # Nightly at Midnight (UTC) # ref: https://crontab.guru/every-night - - cron: '0 0 * * *' + - cron: "0 0 * * *" # Setup the Build Scan "VCS" link for all gradle invocations # @@ -24,51 +24,52 @@ jobs: # Run this job once for each combination in the matrix below. strategy: matrix: - os: [ ubuntu-latest, windows-latest ] - java-distribution: [ temurin ] - java-version: [ 11, 17 ] + os: [ubuntu-latest, windows-latest] + java-distribution: [temurin] + java-version: [17] fail-fast: false name: Nightly MegaMekLab Maven CI ${{ matrix.os }} on ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} steps: - # Checkout the latest source and put it in: ./megameklab - - uses: actions/checkout@v3 - with: - path: megameklab + # Checkout the latest source and put it in: ./megameklab + - uses: actions/checkout@v4 + with: + path: megameklab - # Composite Build is NOT setup for this job. + # Composite Build is NOT setup for this job. - # Checkout the latest MegaMek source and put it in: ./megamek - - name: Checkout MegaMek - uses: actions/checkout@v3 - with: - repository: MegaMek/megamek - path: megamek + # Checkout the latest MegaMek source and put it in: ./megamek + - name: Checkout MegaMek + uses: actions/checkout@v4 + with: + repository: MegaMek/megamek + path: megamek - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} + # Setup the requested Java Distribution and Version from the matrix + - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.java-distribution }} + java-version: ${{ matrix.java-version }} - # Don't run this for Windows. - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: megameklab - run: chmod +x gradlew - if: runner.os != 'Windows' - - # Include --stacktrace to make some build failures easier to figure out. - - name: Build with Gradle - uses: gradle/gradle-build-action@v2 - with: - arguments: clean build --continue --stacktrace --max-workers=1 --scan - build-root-directory: megameklab + # Don't run this for Windows. + - name: Grant execute permission for gradlew (*nix or MacOS) + working-directory: megameklab + run: chmod +x gradlew + if: runner.os != 'Windows' - - name: Upload Test Logs on Failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: ${{ matrix.os }}-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}-maven-ci-failure-logs - path: megameklab/megameklab/build/reports/ + # Include --stacktrace to make some build failures easier to figure out. + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + working-directory: megameklab + run: ./gradlew clean build --continue --stacktrace --max-workers=1 --scan + + - name: Upload Test Logs on Failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: ${{ matrix.os }}-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}-maven-ci-failure-logs + path: megameklab/megameklab/build/reports/ diff --git a/.github/workflows/update-maven-repo.yml b/.github/workflows/update-maven-repo.yml deleted file mode 100644 index acd302eac..000000000 --- a/.github/workflows/update-maven-repo.yml +++ /dev/null @@ -1,98 +0,0 @@ -# This workflow updates the MML Maven Repo on push to master -name: Update Maven Repo - -on: - push: - branches: [ master ] - paths: - - 'megameklab/src/**' - - 'megameklab/resources/**' - -jobs: - update_maven_repo: - runs-on: ${{ matrix.os }} - - # Run this job once for each combination in the matrix below. - strategy: - matrix: - os: [ ubuntu-latest ] # For Maven Repository Update running on *nix is sufficient - java-distribution: [ temurin ] - java-version: [ 17 ] - - steps: - # Put the MML repo in a subfolder to make updating the Maven repo easier - - uses: actions/checkout@v3 - with: - path: megameklab - - # Grab the MM repo too - - uses: actions/checkout@v3 - with: - repository: MegaMek/megamek - path: megamek - - # Setup composite build for MML - # see: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle - - name: Setup Composite Build for MML - working-directory: megameklab - run: | - echo "includeBuild '../megamek'" >settings_local.gradle - - # Setup the requested Java Distribution and Version from the matrix - - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: ${{ matrix.java-distribution }} - java-version: ${{ matrix.java-version }} - - # Make sure we can execute the Gradle wrapper - - name: Grant execute permission for gradlew (*nix or MacOS) - working-directory: megameklab - run: chmod +x gradlew - if: runner.os != 'Windows' - - # Create the actual maven repo bits with Gradle - - name: Publish Maven Repo with Gradle - working-directory: megameklab - run: ./gradlew publishPublishMMLibraryPublicationToMavenRepository - - # Get the current Maven repo contents - - name: Checkout Maven Repo - if: github.repository == 'MegaMek/megameklab' - uses: actions/checkout@v3 - with: - repository: MegaMek/mavenrepo - path: mavenrepo - - # Create an update - - name: Copy Maven Outputs to Repo - if: github.repository == 'MegaMek/megameklab' - working-directory: megameklab/megameklab/build/mavenrepo/ - run: | - cp -r . ../../../../mavenrepo/ - - # In case we run into an issue, use git status to help us understand what happened. - - name: Inspect git status output - if: github.repository == 'MegaMek/megameklab' - working-directory: mavenrepo - run: | - git status - - # Add the changes under the username and email of the user who pushed the code - - name: Commit changes to the Maven Repo - if: github.repository == 'MegaMek/megameklab' - working-directory: mavenrepo - run: | - git add . - git config user.email ${{ github.event.pusher.email }} - git config user.name ${{ github.event.pusher.name }} - git commit -m "MegaMek ${{ github.event.after }}" -m "${{ github.event.compare }}" - - # Use an SSH deploy key (with write privs) to update the maven repo - - name: Setup SSH and Push changes to the Maven Repo - if: github.repository == 'MegaMek/megameklab' - working-directory: mavenrepo - run: | - eval "$(ssh-agent -s)" - ssh-add - <<< "${{ secrets.MAVEN_REPO_DEPLOY_KEY }}" - git push "git@github.com:MegaMek/mavenrepo.git" HEAD:master diff --git a/.github/workflows/update-maven-repo.yml.disabled b/.github/workflows/update-maven-repo.yml.disabled new file mode 100644 index 000000000..4a66df437 --- /dev/null +++ b/.github/workflows/update-maven-repo.yml.disabled @@ -0,0 +1,98 @@ +# This workflow updates the MML Maven Repo on push to master +name: Update Maven Repo + +on: + push: + branches: [master] + paths: + - "megameklab/src/**" + - "megameklab/resources/**" + +jobs: + update_maven_repo: + runs-on: ${{ matrix.os }} + + # Run this job once for each combination in the matrix below. + strategy: + matrix: + os: [ubuntu-latest] # For Maven Repository Update running on *nix is sufficient + java-distribution: [temurin] + java-version: [17] + + steps: + # Put the MML repo in a subfolder to make updating the Maven repo easier + - uses: actions/checkout@v4 + with: + path: megameklab + + # Grab the MM repo too + - uses: actions/checkout@v4 + with: + repository: MegaMek/megamek + path: megamek + + # Setup composite build for MML + # see: https://github.com/MegaMek/megamek/wiki/Working-With-Gradle + - name: Setup Composite Build for MML + working-directory: megameklab + run: | + echo "includeBuild '../megamek'" >settings_local.gradle + + # Setup the requested Java Distribution and Version from the matrix + - name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.java-distribution }} + java-version: ${{ matrix.java-version }} + + # Make sure we can execute the Gradle wrapper + - name: Grant execute permission for gradlew (*nix or MacOS) + working-directory: megameklab + run: chmod +x gradlew + if: runner.os != 'Windows' + + # Create the actual maven repo bits with Gradle + - name: Publish Maven Repo with Gradle + working-directory: megameklab + run: ./gradlew publishPublishMMLibraryPublicationToMavenRepository + + # Get the current Maven repo contents + - name: Checkout Maven Repo + if: github.repository == 'MegaMek/megameklab' + uses: actions/checkout@v4 + with: + repository: MegaMek/mavenrepo + path: mavenrepo + + # Create an update + - name: Copy Maven Outputs to Repo + if: github.repository == 'MegaMek/megameklab' + working-directory: megameklab/megameklab/build/mavenrepo/ + run: | + cp -r . ../../../../mavenrepo/ + + # In case we run into an issue, use git status to help us understand what happened. + - name: Inspect git status output + if: github.repository == 'MegaMek/megameklab' + working-directory: mavenrepo + run: | + git status + + # Add the changes under the username and email of the user who pushed the code + - name: Commit changes to the Maven Repo + if: github.repository == 'MegaMek/megameklab' + working-directory: mavenrepo + run: | + git add . + git config user.email ${{ github.event.pusher.email }} + git config user.name ${{ github.event.pusher.name }} + git commit -m "MegaMek ${{ github.event.after }}" -m "${{ github.event.compare }}" + + # Use an SSH deploy key (with write privs) to update the maven repo + - name: Setup SSH and Push changes to the Maven Repo + if: github.repository == 'MegaMek/megameklab' + working-directory: mavenrepo + run: | + eval "$(ssh-agent -s)" + ssh-add - <<< "${{ secrets.MAVEN_REPO_DEPLOY_KEY }}" + git push "git@github.com:MegaMek/mavenrepo.git" HEAD:master diff --git a/.github/workflows/write-revision.yml b/.github/workflows/write-revision.yml deleted file mode 100644 index 68ae1b3ab..000000000 --- a/.github/workflows/write-revision.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Write MML Revision" - -on: - push: - branches: - - master - paths: - # only write the revision for changes that affect program behavior - - '**.gradle' - - 'megameklab/src/**' - - 'megameklab/data/**' - -jobs: - write_hashcode: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Write latest revision hashcode to file - run: echo ${{ github.sha }} > megameklab/docs/mml-revision.txt - - - name: Commit and Push Changes - run: | - git config --global user.name 'GitHub Actions' - git config --global user.email 'actions@github.com' - git add megameklab/docs/mml-revision.txt - git commit -m 'Update mml-revision.txt' - git push diff --git a/build.gradle b/build.gradle index a8cd1bf54..7ff334765 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ plugins { - id 'org.ajoberstar.grgit' version '5.0.0' + id 'org.ajoberstar.grgit' version '5.2.2' } allprojects { apply plugin: 'java' - sourceCompatibility = 11 - targetCompatibility = 11 + sourceCompatibility = 17 + targetCompatibility = 17 repositories { mavenLocal() diff --git a/gradle.properties b/gradle.properties index 114fbe4bd..0e09e4c2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -org.gradle.jvmArgs=-Dfile.encoding=utf-8 +org.gradle.jvmArgs=-Xmx4g -XX:MaxPermSize=2048m -Dfile.encoding=utf-8 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f..afba10928 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661ee..20db9ad5c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ 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-8.7-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c..65dcd68d6 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/gradlew.bat b/gradlew.bat index 53a6b238d..6689b85be 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/megameklab/build.gradle b/megameklab/build.gradle index 3180534bb..40a91c397 100644 --- a/megameklab/build.gradle +++ b/megameklab/build.gradle @@ -3,7 +3,7 @@ import java.time.LocalDateTime plugins { id 'application' id 'maven-publish' - id 'edu.sc.seis.launch4j' version '2.5.4' + id 'edu.sc.seis.launch4j' version '3.0.5' id 'jacoco' } @@ -29,38 +29,40 @@ sourceSets { dependencies { implementation "org.megamek:megamek${mmBranchTag}:${version}" - implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0' - implementation 'org.apache.logging.log4j:log4j-core:2.20.0' - implementation 'org.apache.pdfbox:pdfbox:2.0.27' - implementation ('org.apache.xmlgraphics:batik-bridge:1.14') { + implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2' + implementation 'org.apache.logging.log4j:log4j-core:2.23.1' + implementation 'org.apache.pdfbox:pdfbox:2.0.31' + implementation ('org.apache.xmlgraphics:batik-bridge:1.17') { // We don't need the python and javascript engine taking up space exclude group: 'org.python', module: 'jython' exclude group: 'org.mozilla', module: 'rhino' exclude group: 'xml-apis' } - implementation ('org.apache.xmlgraphics:batik-codec:1.14') { + implementation ('org.apache.xmlgraphics:batik-codec:1.17') { exclude group: 'xml-apis' } - implementation ('org.apache.xmlgraphics:batik-dom:1.14') { + implementation ('org.apache.xmlgraphics:batik-dom:1.17') { exclude group: 'xml-apis' } - implementation 'org.apache.xmlgraphics:batik-rasterizer:1.14' - implementation 'org.apache.xmlgraphics:batik-svggen:1.14' - implementation ('org.apache.xmlgraphics:fop:2.7') { + implementation 'org.apache.xmlgraphics:batik-rasterizer:1.17' + implementation 'org.apache.xmlgraphics:batik-svggen:1.17' + implementation ('org.apache.xmlgraphics:fop:2.9') { // We don't need this proprietary module exclude group: 'com.sun.media', module: 'jai-codec' exclude group: 'xml-apis' } - testImplementation 'org.mockito:mockito-core:5.2.0' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' + testImplementation 'org.mockito:mockito-core:5.12.0' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' - runtimeOnly 'org.glassfish.jaxb:jaxb-runtime:4.0.2' + runtimeOnly 'org.glassfish.jaxb:jaxb-runtime:4.0.5' //Required for printing scaled vector graphics (SVG) - EclipseIDE Comipatability. runtimeOnly 'xml-apis:xml-apis-ext:1.3.04' } -mainClassName = 'megameklab.MegaMekLab' +application { + mainClass = 'megameklab.MegaMekLab' +} ext { mmlJvmOptions = ['-Xmx1024m'] @@ -80,17 +82,11 @@ ext { scriptTemplate = "${scriptsDir}/startScriptTemplate.txt" } -task compileMM (type: GradleBuild) { - description = 'Compiles the MM directory for packaging in a Jar' - - buildName = "mml-compile-mm" - dir = "${mmDir}" - tasks = [ 'compileTestJava' ] -} - -task mmJar (type: Jar, dependsOn: compileMM) { +task mmJar (type: Jar) { description = 'Builds a MegaMek jar from the current source' + dependsOn gradle.includedBuild('megamek').task(':megamek:compileTestJava') + archiveFileName = "MegaMek.jar" from "${mmDir}/megamek/build/classes/java/main" from "${mmDir}/megamek/build/resources/main" @@ -111,7 +107,7 @@ task mmJar (type: Jar, dependsOn: compileMM) { jar { archiveFileName = "MegaMekLab.jar" manifest { - attributes "Main-Class" : mainClassName + attributes "Main-Class" : application.mainClass attributes "Class-Path" : "${lib}/${mmJar.archiveFileName.get()} " + (project.sourceSets.main.runtimeClasspath.files .findAll { it.name.endsWith(".jar") && !it.name.toLowerCase().startsWith("megamek") } .collect { "${lib}/${it.name}" }.join(' ')) @@ -218,21 +214,28 @@ distributions { createExe { description = 'Create Windows executable that wraps MegaMekLab jar' mainClassName = project.mainClassName - jar = "${project.tasks.getByName("jar").archiveFile.get()}" + jarTask = project.tasks.jar icon = "${projectDir}/data/images/misc/megameklab.ico" internalName = 'MegaMekLab' + downloadUrl = 'https://adoptium.net/temurin/releases/?os=windows&arch=x64' + supportUrl = 'https://megamek.org' + copyright = '2024 MegaMek Development Team' + companyName = "MegaMek Development Team" classpath = ["lib/${mmJar.archiveFileName.get()}"] + project.sourceSets.main.runtimeClasspath.files .findAll { it.name.endsWith(".jar") && !it.name.toLowerCase().startsWith("megamek")} .collect { "${lib}/${it.name}" } - def iniFile = outfile.replace('.exe', '.l4j.ini') outputs.file "${buildDir}/launch4j/${outfile}" - outputs.file "${buildDir}/launch4j/${iniFile}" - doLast { - new File("${buildDir}/${outputDir}/${iniFile}").text = """# Launch4j runtime config -# you can add arguments here that will be processed by the JVM at runtime -${project.ext.mmlJvmOptions.join('\n')} -""" - } + jvmOptions = project.ext.mmlJvmOptions + jreMinVersion = '17' + messagesJreNotFoundError = 'Go here for instructions on installing the correct version of Java: https://github.com/MegaMek/megamek/wiki/Updating-to-Adoptium' +} + +windowsDistTar { + description = 'Creates Windows distribution packaged as a tar.gz archive' + dependsOn stageFiles + dependsOn createExe + archiveExtension = 'tar.gz' + compression = Compression.GZIP } windowsDistZip { @@ -241,6 +244,12 @@ windowsDistZip { dependsOn createExe } +unixDistZip { + description = 'Creates *nix distribution packaged as a zip' + dependsOn stageFiles + dependsOn startScripts +} + unixDistTar { description = 'Creates *nix distribution packaged as a tar ball' dependsOn stageFiles @@ -249,6 +258,22 @@ unixDistTar { compression = Compression.GZIP } +distZip { + description = 'Creates *nix distribution packaged as a zip' + dependsOn stageFiles + dependsOn createStartScripts + dependsOn startScripts +} + +distTar { + description = 'Creates *nix distribution packaged as a tar ball' + dependsOn stageFiles + dependsOn createStartScripts + dependsOn startScripts + archiveExtension = 'tar.gz' + compression = Compression.GZIP +} + // The repository can only be cloned into an empty directory so we need to delete anything left over // from a previous build task deleteMMRepoDir (type: Delete) { diff --git a/settings.gradle b/settings.gradle index b2f621218..62fa9842e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,7 @@ include 'megameklab' // includeBuild('../megamek') will use the local megamek repository instead of a binary jar to fulfill // the dependency. -def localSettings = file('settings_local.gradle') +def localSettings = file('./settings_local.gradle') if (localSettings.exists()) { apply from: localSettings }