Skip to content

Commit

Permalink
Increment version, remove android compile task
Browse files Browse the repository at this point in the history
  • Loading branch information
skykatik committed Jul 17, 2021
1 parent a4ed7c9 commit b1b0fa8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ If you use for a server, you can also start the server automatically, use [this

## Building

* Windows: `gradlew desktop`
* *nix/Mac OS: `./gradlew desktop`
* Windows: `gradlew dist`
* *nix/Mac OS: `./gradlew dist`

After building, the `.jar` file should be located in `build/libs` folder.

Expand Down
2 changes: 1 addition & 1 deletion assets/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "inside.updater.Loader",
"hidden": true,
"java": true,
"version": "0.8",
"version": "0.9",
"minGameVersion": 120,
"repo": "MindustryInside/AutoUpdater"
}
24 changes: 2 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ repositories{

ext{
def json = new JsonSlurper()
def libs = "$rootDir/build/libs"
def modFile = file("${sourceSets.main.resources.srcDirs.last()}/mod.json")
def mod = json.parseText(modFile.text)

artifactBaseName = mod.name + (!mod.version.isEmpty() ? "-$mod.version" : "")

jarPath = "$libs/${artifactBaseName}-desktop.jar"
dexPath = "$libs/${artifactBaseName}-android.jar"

versions = [:]
versions.mindustry = '126.2'
versions.jabel = '0.4.1'
Expand All @@ -38,8 +34,8 @@ dependencies{
annotationProcessor "com.github.MindustryInside:jabel:$versions.jabel"
}

task desktop(type: Jar){
archiveBaseName.set "$artifactBaseName-desktop"
task dist(type: Jar){
archiveBaseName.set artifactBaseName

from{
configurations.runtimeClasspath.collect{it.isDirectory() ? it : zipTree(it)}
Expand All @@ -48,22 +44,6 @@ task desktop(type: Jar){
with jar
}

task android(type: Exec, dependsOn: desktop){
def command = ['d8', jarPath, '--min-api', '28', '--output', dexPath]

if(System.getProperty('os.name').toLowerCase().contains('windows')){
commandLine("cmd", "/c", *command)
}else{
commandLine(*command)
}
}

task dist(type: Jar, dependsOn: android){
archiveBaseName.set artifactBaseName

from zipTree(jarPath), zipTree(dexPath)
}

tasks.withType(JavaCompile){
if(JavaVersion.current() != JavaVersion.VERSION_1_8){
options.compilerArgs = ['--release', '8', '--enable-preview']
Expand Down

0 comments on commit b1b0fa8

Please sign in to comment.