Skip to content

Commit

Permalink
Merge pull request #776 from Bram-Hub/dev
Browse files Browse the repository at this point in the history
LEGUP 6.0.1 March Push
  • Loading branch information
Chase-Grajeda authored Apr 2, 2024
2 parents 32371ed 4781736 commit a0c7dcf
Show file tree
Hide file tree
Showing 157 changed files with 3,117 additions and 984 deletions.
63 changes: 58 additions & 5 deletions .github/workflows/java-autoformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 2,10 @@ name: Java Code Auto Format
on: pull_request

jobs:
format:
if: github.event.pull_request.head.repo.full_name == github.repository
format_dev:
if: |
github.event.pull_request.head.ref == 'dev' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -15,7 17,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 21
distribution: temurin

- name: Grant execute permission for gradlew
run: chmod x gradlew
Expand All @@ -28,7 29,58 @@ jobs:

- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
run: echo "modified=$(if [[ -n $(git status -s) ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT

- name: Create temporary branch and pull request
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Bram van Heuveln'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
branch_name="auto-format-code-$(date %s)"
git checkout -b $branch_name
./gradlew :spotlessApply
git add .
git commit -am "Automated Java code formatting changes"
git push --set-upstream origin $branch_name
gh pr create -B dev -H $branch_name --title 'Automated Java code formatting changes' --body 'This pull request contains automated code formatting changes.' --reviewer ${{ github.actor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Must approve auto-format pull request
if: steps.git-check.outputs.modified == 'true'
run: |
echo "Please review and approve the appropriate auto-format-code pull request."
exit 1
format_pull_request_to_dev:
if: |
github.event.pull_request.base.ref == 'dev' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
with:
ref: ${{ github.head_ref }}

- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 21

- name: Grant execute permission for gradlew
run: chmod x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

- name: Run spotless
run: ./gradlew :spotlessApply

- name: Check for modified files
id: git-check
run: echo "modified=$(if [[ -n $(git status -s) ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT

- name: Push changes
if: steps.git-check.outputs.modified == 'true'
Expand All @@ -37,4 89,5 @@ jobs:
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add .
git diff --cached --exit-code || git commit -am "Automated Java code formatting changes" && git push
git commit -am "Automated Java code formatting changes"
git push
3 changes: 2 additions & 1 deletion .github/workflows/publish-javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 18,7 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 11
java-version: 21
distribution: temurin
target-folder: docs
project: gradle
34 changes: 0 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,40 104,6 @@ jar {
archiveFileName = 'Legup.jar'
}

/*
* CREATES NATIVE WINDOWS EXECUTABLE
* Launches launch4j to create an executable (.exe) file wrapping the jar
* THIS IS NOT THE INSTALLER
* Add "icon = 'path/to/icon.ico'" to set an icon for the executable
*/
createExe() {
mainClassName = 'edu.rpi.legup.Legup'
outputDir = '../native/windows'
outfile = 'bin/Legup.exe'
bundledJrePath = 'jre'
bundledJre64Bit = true
jdkPreference = 'preferJre'
jreMinVersion = '21'
jreRuntimeBits = '64/32'
}

/*
* CREATES NATIVE WINDOWS INSTALLER -- ONLY RUNS ON WINDOWS
* Runs the shipped version of Inno Setup (6.2) to compile the installer
* Modify the setup settings in native/windows/legup_inno_setup.iss
*
* Modifications are likely required to run the setup script on your computer:
* Edit the "CHANGE ME" line in native/windows/legup_inno_setup.iss to reflect
* the path to the Java installation you want to ship inside the executable.
*/
task buildNativeWindows(type: Exec, dependsOn: 'createExe') {
jar
createExe

workingDir = "${buildDir}/../native/windows"
commandLine 'cmd', '/c', 'make_windows_installer.bat'
}

repositories {
mavenCentral()
}
Expand Down
Empty file removed native/linux/.keep
Empty file.
Empty file removed native/macos/.keep
Empty file.
53 changes: 0 additions & 53 deletions native/windows/OLD_inno_setup.iss

This file was deleted.

Binary file removed native/windows/inno-setup/Compil32.exe
Binary file not shown.
Loading

0 comments on commit a0c7dcf

Please sign in to comment.