-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from jjelliott/gradle-and-exe-build
Gradle Conversion + EXE Build
- Loading branch information
Showing
99 changed files
with
499 additions
and
1,420 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# These are explicitly windows files and should use crlf | ||
*.bat text eol=crlf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
bin | ||
dist | ||
release | ||
BuildCommit.java | ||
build-info.properties | ||
|
||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
# Ignore Gradle build output directory | ||
build | ||
|
||
|
||
database.xml | ||
installedMaps.xml | ||
config.properties | ||
jre/ | ||
|
||
# ide files | ||
# These can be regenerated with `gradlew eclipse` so they no longer need to be committed | ||
.classpath | ||
.project | ||
.settings/ | ||
|
||
*.iml | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
plugins { | ||
id 'java' | ||
id 'eclipse' | ||
id 'application' | ||
// id 'com.palantir.graal' version '0.9.0' | ||
id "com.github.spotbugs" version "4.7.1" | ||
id 'edu.sc.seis.launch4j' version '2.5.0' | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
version = "git describe --tags".execute().text.trim() | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'edu.stanford.ejalbert:BrowserLauncher2:1.3' | ||
} | ||
|
||
application { | ||
mainClass.set('de.haukerehfeld.quakeinjector.QuakeInjector') | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes["Main-Class"] = application.mainClass.get() | ||
} | ||
} | ||
|
||
//graal { | ||
// javaVersion "11" | ||
// graalVersion "21.1.0" | ||
// outputName "quake-injector" | ||
// mainClass application.mainClassName | ||
// option "--no-fallback" | ||
// option "--verbose" | ||
//} | ||
|
||
task readCommit(type: WriteProperties) { | ||
outputFile = file("${buildDir}/build-info.properties") | ||
comment = "Revision name" | ||
property("quake-injector.build-commit", version) | ||
} | ||
|
||
launch4j { | ||
mainClassName = application.mainClass.get() | ||
icon = "${projectDir}/src/main/resources/Inject2.ico" | ||
bundledJrePath "./runtime" | ||
bundledJre64Bit false | ||
} | ||
|
||
processResources { | ||
from(readCommit) | ||
} | ||
|
||
task downloadJre { | ||
def targetDir = "$buildDir/jre" | ||
def f = new File("$buildDir/jre.zip") | ||
f.parentFile.mkdir() | ||
if (!f.exists()) { | ||
new URL('https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10_openj9-0.26.0/OpenJDK8U-jre_x86-32_windows_openj9_8u292b10_openj9-0.26.0.zip').withInputStream {i -> f.withOutputStream {it << i}} | ||
} | ||
|
||
copy { | ||
from zipTree("$buildDir/jre.zip") | ||
into(targetDir) | ||
fileMode 0777 | ||
dirMode 0777 | ||
} | ||
} | ||
|
||
task setupWinDist(type: Copy) { | ||
dependsOn("createExe", "downloadJre") | ||
group "distribution" | ||
def targetDir = "$buildDir/winDist" | ||
mkdir(targetDir) | ||
File jreDir | ||
doLast { | ||
copy { | ||
file("$buildDir/jre").eachDir { | ||
if (it.name.contains("jre")) { | ||
jreDir = it | ||
} | ||
} | ||
if (jreDir) { | ||
from(jreDir) | ||
into("$targetDir/runtime") | ||
} | ||
} | ||
} | ||
from("$buildDir/launch4j") | ||
into(targetDir) | ||
} | ||
|
||
task winDist(type: Zip) { | ||
dependsOn "setupWinDist" | ||
group "distribution" | ||
def distDir = "$buildDir/winDist" | ||
from "$distDir" | ||
archiveFileName = "QuakeInjector.exe-${project.version}.zip" | ||
exclude("*-jre") | ||
|
||
} | ||
test { | ||
useJUnitPlatform() | ||
} |
Oops, something went wrong.