Skip to content

Commit

Permalink
Merge pull request #4348 from rjhancock/rjh-sentry-unhandled
Browse files Browse the repository at this point in the history
Sentry Additions
  • Loading branch information
IllianiCBT authored Jul 7, 2024
2 parents 8ed1cb1 + 5222f64 commit a36d3e1
Show file tree
Hide file tree
Showing 15 changed files with 868 additions and 627 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
fi
exit 0
- name: Add MMRevision file
run: |
echo ${{ steps.find_mm.outputs.mmBranch }} >> mekhq/MekHQ/mm-revision.txt
- name: Checkout MegaMek
uses: actions/checkout@v4
with:
Expand All @@ -67,6 +71,10 @@ jobs:
fi
exit 0
- name: Add MMLRevision file
run: |
echo ${{ steps.find_mml.outputs.mmlBranch }} >> mekhq/MekHQ/mml-revision.txt
- name: Checkout MegaMekLab
uses: actions/checkout@v4
with:
Expand All @@ -87,6 +95,10 @@ jobs:
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"

- name: Add MHQRevision file
run: |
echo ${{ github.sha }} >> mekhq/MekHQ/mhq-revision.txt
- name: Build with Gradle
working-directory: mekhq
run: ./gradlew build --stacktrace --scan
Expand All @@ -105,14 +117,14 @@ jobs:
fail_ci_if_error: false
verbose: true

- name: Upload Windows Release
- name: Upload Tar GZ Artifact
uses: actions/upload-artifact@v4
with:
name: mhq-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: ./mekhq/MekHQ/build/distributions/mekhq-windows-*.zip
name: mhq-release-tgz-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: mekhq/MekHQ/build/distributions/MekHQ-*.tar.gz

- name: Upload Nix/Mac Release
- name: Upload Zip Release
uses: actions/upload-artifact@v4
with:
name: mhq-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: ./mekhq/MekHQ/build/distributions/mekhq-unix-*.tar.gz
name: mhq-release-zip-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: mekhq/MekHQ/build/distributions/MekHQ-*.zip
16 changes: 10 additions & 6 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"

- name: Add MHQRevision file
run: |
echo ${{ github.sha }} >> mekhq/MekHQ/mhq-revision.txt
- name: Build with Gradle
working-directory: megameklab
run: ./gradlew clean build --stacktrace --scan
Expand All @@ -61,14 +65,14 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}-ci-failure-logs
path: mekhq/MekHQ/build/reports/

- name: Upload Nix/Mac Releases
- name: Upload Tar GZ Artifact
uses: actions/upload-artifact@v4
with:
name: mhq-release-nix-mac-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: mekhq/MekHQ/build/distributions/mekhq-unix-*.tar.gz
name: mhq-release-tgz-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: mekhq/MekHQ/build/distributions/MekHQ-*.tar.gz

- name: Upload Windows Release
- name: Upload Zip Release
uses: actions/upload-artifact@v4
with:
name: mhq-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: mekhq/MekHQ/build/distributions/mekhq-windows-*.zip
name: mhq-release-zip-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: mekhq/MekHQ/build/distributions/MekHQ-*.zip
141 changes: 10 additions & 131 deletions MekHQ/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import java.time.LocalDateTime

plugins {
id 'application'
id 'maven-publish'
id 'edu.sc.seis.launch4j' version '3.0.5'
id 'jacoco'
id 'java'
id "io.sentry.jvm.gradle" version "4.9.0"
}

java {
Expand Down Expand Up @@ -199,6 +199,10 @@ task stageFiles(type: Copy) {
include "${userdata}/data/universe/"
include 'license.txt'
include 'SubmitBug.html'
include "sentry.properties"
include "mm-revision.txt"
include "mml-revision.txt"
include "mhq-revision.txt"

into fileStagingDir

Expand All @@ -207,7 +211,7 @@ task stageFiles(type: Copy) {
inputs.dir "${docs}"
inputs.dir "${mmconf}"
inputs.dir "${project.ext.plugins}"
inputs.files 'license.txt', 'SubmitBug.html'
inputs.files 'license.txt', 'SubmitBug.html', 'sentry.properties', 'mm-revision.txt', 'mml-revision.txt', 'mhq-revision.txt'
outputs.dir fileStagingDir

doLast {
Expand Down Expand Up @@ -239,81 +243,8 @@ task createStartScripts (type: CreateStartScripts) {
}

distributions {
// Creates tasks which package distribution with MM jar and startup script in root directory
unix {
distributionBaseName = 'mekhq-unix'
contents {
// MegaMek Includes
from ("${mmDir}/megamek/build/files")
from ("${mmDir}/megamek/build/scripts") {
include 'mm*'
rename 'mm(.*)', 'mm-startup$1'
}
from ("${mmDir}/megamek/${docs}/history.txt") {
rename 'history.txt', 'mm-history.txt'
into 'docs'
}
from ("${mmDir}/megamek/${mmconf}/log4j2.xml") {
exclude 'log4j2.xml'
}
from ("${mmDir}/megamek/build/launch4j/lib") {
into "${lib}"
}
from (mmJar) {
into "${lib}"
}
from (mmJar)

// MegaMek Includes
from ("${mmlDir}/megameklab/build/launch4j/lib") {
into "${lib}"
}
from ("${mmlDir}/megameklab/build/files/${data}/images") {
into "${data}/images"
}
from ("${mmlDir}/megameklab/build/scripts") {
include 'mml*'
rename 'mml(.*)', 'mml-startup$1'
}
from ("${mmlDir}/megameklab/${docs}/history.txt") {
rename 'history.txt', 'mml-history.txt'
into "${docs}"
}
from ("${mmlDir}/megameklab/${mmconf}/log4j2.xml") {
exclude 'log4j2.xml'
}
from (mmlJar) {
into "${lib}"
}
from (mmlJar)

// MekHQ Includes
from ("docs/history.txt") {
rename 'history.txt', 'mhq-history.txt'
into 'docs'
}
from (fileStagingDir) {
exclude 'history.txt'
}
from (createStartScripts) {
include 'mhq*'
rename 'mhq(.*)', 'mhq-startup$1'
}

from (project.sourceSets.main.runtimeClasspath.files
.findAll { it.name.endsWith(".jar") && !it.name.toLowerCase().startsWith("megamek") }) {
into "${lib}"
}
from(jar) {
into "${lib}"
}
from (jar)
duplicatesStrategy = 'exclude'
}
}
// Creates tasks which package distribution with MM jar wrapped in Windows executable
windows {
distributionBaseName = 'mekhq-windows'
main {
distributionBaseName = 'MekHQ'
contents {
// MegaMek Includes
from ("${mmDir}/megamek/build/files")
Expand Down Expand Up @@ -444,40 +375,11 @@ tasks.register("packagePrepWork") {
dependsOn stageMM
dependsOn createStartScripts
dependsOn startScripts
}

tasks.register("createAllMMExes") {
dependsOn createAllExecutables
dependsOn createMMExe
dependsOn createMMLExe
}

windowsDistZip {
description = 'Creates Windows distribution packaged as a zip archive'
dependsOn packagePrepWork
dependsOn createAllMMExes
}

windowsDistTar {
description = 'Creates Windows distribution packaged as a zip archive'
dependsOn packagePrepWork
dependsOn createAllMMExes
archiveExtension = 'tar.gz'
compression = Compression.GZIP
}

unixDistTar {
description = 'Creates *nix distribution packaged as a tar ball'
dependsOn packagePrepWork
archiveExtension = 'tar.gz'
compression = Compression.GZIP
}

unixDistZip {
description = 'Creates *nix distribution packaged as a tar ball'
dependsOn packagePrepWork
}

distTar {
description = 'Creates *nix distribution packaged as a tar ball'
dependsOn packagePrepWork
Expand Down Expand Up @@ -559,8 +461,8 @@ task assembleDist(overwrite: true) {
group = 'distribution'
dependsOn stageMM
dependsOn test
dependsOn unixDistTar
dependsOn windowsDistZip
dependsOn distTar
dependsOn distZip
}

task buildFromRepo (type: GradleBuild) {
Expand Down Expand Up @@ -639,29 +541,6 @@ task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
}

publishing {
publications {
publishMMLibrary(MavenPublication) {
artifactId = "mekhq${mmBranchTag}"
from components.java
artifact sourcesJar
// artifact javadocJar

pom {
name = "MekHQ"
description = "MekHQ"
url = "https://megamek.org"
licenses {
license {
name = "GNU General Public License, version 3"
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
}
}
}
}
}
}

test {
useJUnitPlatform()
// report is always generated after tests run
Expand Down
1 change: 1 addition & 0 deletions MekHQ/sentry.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enabled=false
Loading

0 comments on commit a36d3e1

Please sign in to comment.