Skip to content

Commit

Permalink
Merge pull request #1547 from rjhancock/rjh-sentry-unhandled
Browse files Browse the repository at this point in the history
Added Sentry
  • Loading branch information
IllianiCBT authored Jul 7, 2024
2 parents 5b8af69 + 500667a commit 97fe3c4
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 154 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ jobs:
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"

- name: Add MMLRevision file
run: |
echo ${{ github.sha }} >> megameklab/megameklab//mml-revision.txt
- name: Build with Gradle
working-directory: megameklab
run: ./gradlew build --stacktrace --scan
Expand All @@ -81,14 +85,14 @@ jobs:
fail_ci_if_error: false
verbose: true

- name: Upload Windows Release
- name: Upload Zip Release
uses: actions/upload-artifact@v4
with:
name: mml-release-win-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: ./megameklab/megameklab/build/distributions/megameklab-windows-*.zip
name: mml-release-zip-${{ matrix.java-distribution }}-jdk${{ matrix.java-version }}
path: ./megameklab/megameklab/build/distributions/MegaMekLab-*.zip

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

- name: Add MMLRevision file
run: |
echo ${{ github.sha }} >> megameklab/megameklab/mml-revision.txt
- name: Build with Gradle
working-directory: megameklab
run: ./gradlew clean build --stacktrace --scan
Expand Down
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ java {
allprojects {
repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
}
}
}

Expand Down
92 changes: 10 additions & 82 deletions megameklab/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,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 @@ -130,14 +130,16 @@ task stageFiles(type: Copy) {
include "${docs}/**"
include 'license.txt'
include 'SubmitBug.html'
include "sentry.properties"
include "mml-revision.txt"
exclude "**/*.psd"

into fileStagingDir

inputs.dir "${mmconf}"
inputs.dir "${data}"
inputs.dir "${docs}"
inputs.files 'license.txt', 'SubmitBug.html'
inputs.files 'license.txt', 'SubmitBug.html', 'sentry.properties', 'mml-revision.txt'
outputs.dir fileStagingDir

doLast {
Expand Down Expand Up @@ -168,34 +170,8 @@ task createStartScripts (type: CreateStartScripts) {
}

distributions {
// Creates tasks which package distribution with MM jar and startup script in root directory
unix {
distributionBaseName = 'megameklab-unix'
contents {
from ("${mmDir}/megamek/mmconf/log4j2.xml") {
exclude 'log4j2.xml'
}
from (fileStagingDir) {
exclude 'history.txt'
}
from (createStartScripts) {
include 'mml*'
rename 'mml(.*)', 'mml-startup$1'
}
from (mmJar) {
into "${lib}"
}
from (jar)
from (project.sourceSets.main.runtimeClasspath.files
.findAll { it.name.endsWith(".jar") && !it.name.toLowerCase().startsWith("megamek") }) {
into "${lib}"
}
duplicatesStrategy = 'exclude'
}
}
// Creates tasks which package distribution with MM jar wrapped in Windows executable
windows {
distributionBaseName = 'megameklab-windows'
main {
distributionBaseName = 'MegaMekLab'
contents {
from ("${mmDir}/megamek/mmconf/log4j2.xml") {
exclude 'log4j2.xml'
Expand Down Expand Up @@ -252,41 +228,16 @@ tasks.register("packagePrepWork") {
dependsOn stageFiles
dependsOn startScripts
dependsOn createStartScripts
}

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

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

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

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

distZip {
description = 'Creates *nix distribution packaged as a zip'
description = 'Creates zip Package'
dependsOn packagePrepWork
}

distTar {
description = 'Creates *nix distribution packaged as a tar ball'
description = 'Creates a TGZ package'
dependsOn packagePrepWork
archiveExtension = 'tar.gz'
compression = Compression.GZIP
Expand Down Expand Up @@ -349,8 +300,8 @@ task assembleDist(overwrite: true) {
description = 'Build unix, Windows, and source packages'
group = 'distribution'
dependsOn test
dependsOn unixDistTar
dependsOn windowsDistZip
dependsOn distTar
dependsOn distZip
}

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

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

pom {
name = "MegaMekLab"
description = "MegaMekLab"
url = "https://megamek.org"
licenses {
license {
name = "GNU General Public License, version 2"
url = "https://www.gnu.org/licenses/gpl-2.0.html"
}
}
}
}
}
}

test {
useJUnitPlatform()
// report is always generated after tests run
Expand Down
1 change: 1 addition & 0 deletions megameklab/sentry.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enabled=false
18 changes: 9 additions & 9 deletions megameklab/src/megameklab/MMLConstants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 - The MegaMek Team. All Rights Reserved.
* Copyright (c) 2021-2024 - The MegaMek Team. All Rights Reserved.
*
* This file is part of MegaMekLab.
*
Expand All @@ -24,16 +24,16 @@
* These are constants that hold across MegaMekLab.
*/
public final class MMLConstants extends SuiteConstants {
//region General Constants
// region General Constants
public static final String PROJECT_NAME = "MegaMekLab";
//endregion General Constants
// endregion General Constants

//region GUI Constants
//endregion GUI Constants
// region GUI Constants
// endregion GUI Constants

//region MMLOptions
//endregion MMLOptions
// region MMLOptions
// endregion MMLOptions

//region File Paths
//endregion File Paths
// region File Paths
// endregion File Paths
}
6 changes: 3 additions & 3 deletions megameklab/src/megameklab/MMLOptions.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 - The MegaMek Team. All Rights Reserved.
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved.
*
* This file is part of MegaMekLab.
*
Expand All @@ -21,9 +21,9 @@
import megamek.SuiteOptions;

public class MMLOptions extends SuiteOptions {
//region Constructors
// region Constructors
public MMLOptions() {
super();
}
//endregion Constructors
// endregion Constructors
}
6 changes: 3 additions & 3 deletions megameklab/src/megameklab/MMLOptionsChangedEvent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 - The MegaMek Team. All Rights Reserved.
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved.
*
* This file is part of MegaMekLab.
*
Expand All @@ -25,9 +25,9 @@
* The event handlers cannot modify these options.
*/
public class MMLOptionsChangedEvent extends MMEvent {
//region Constructors
// region Constructors
public MMLOptionsChangedEvent() {
super();
}
//endregion Constructors
// endregion Constructors
}
Loading

0 comments on commit 97fe3c4

Please sign in to comment.