Skip to content

Commit

Permalink
Merge branch 'dev' into thermometer
Browse files Browse the repository at this point in the history
  • Loading branch information
morenomarcus03 authored Apr 16, 2024
2 parents 2c7f9d4 + 4e64baf commit 0d36dac
Show file tree
Hide file tree
Showing 223 changed files with 6,062 additions and 989 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
6 changes: 5 additions & 1 deletion bin/main/edu/rpi/legup/legup/config
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@
<puzzle name="Sudoku" qualifiedClassName="edu.rpi.legup.puzzle.sudoku.Sudoku"
fileType=".xml"
fileCreationDisabled="true"/>
<puzzle name="StarBattle"
qualifiedClassName="edu.rpi.legup.puzzle.starbattle.StarBattle"
fileType=".xml"
fileCreationDisabled="true"/>
<puzzle name="TreeTent"
qualifiedClassName="edu.rpi.legup.puzzle.treetent.TreeTent"
fileType=".xml"
fileCreationDisabled="false"/>
<puzzle name="Skyscrapers"
qualifiedClassName="edu.rpi.legup.puzzle.skyscrapers.Skyscrapers"
fileType=".xml"
fileCreationDisabled="false"/>
fileCreationDisabled="true"/>
</puzzles>
</Legup>
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 0d36dac

Please sign in to comment.