Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
Gradle tasks for building release jar and zip
Browse files Browse the repository at this point in the history
  • Loading branch information
maltaisn committed May 4, 2019
1 parent 5663bdc commit a33f35a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ todo.txt
testMazes/

build/
releases/
.idea/
.gradle/

META-INF/
launch4j-config.xml
File renamed without changes.
45 changes: 39 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildscript {
ext {
kotlinVersion = "1.3.31"
junitVersion = "5.4.2"
mazegenVersion = "1.1.0"
}
repositories {
mavenCentral()
Expand All @@ -13,13 +14,30 @@ buildscript {
}

apply plugin: "kotlin"
apply plugin: "idea"

repositories {
mavenCentral()
jcenter()
maven { url { "https://oss.sonatype.org/content/repositories/snapshots/"}}
}

idea {
module {
outputDir file("build/classes/main")
testOutputDir file("build/classes/test")
}
}

sourceSets.main.java.srcDirs = ["src/main/kotlin"]
sourceSets.test.java.srcDirs = ["src/test/kotlin"]
project.buildDir = "build/"

java {
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
Expand All @@ -30,11 +48,26 @@ dependencies {
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}

sourceSets.main.java.srcDirs = ["src/main/kotlin"]
sourceSets.test.java.srcDirs = ["src/test/kotlin"]
buildDir = "build/"

java {
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'com.maltaisn.mazegen.MainKt'
}
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

task releaseZip(type: Zip) {
dependsOn fatJar
from(project.rootDir) {
include "mazegen.bat"
include "README.md"
include "CHANGELOG.md"
include "LICENSE"
}
from("build/libs/") {
include "mazegen.jar"
}
archiveName "releases/mazegen-${mazegenVersion}.zip"
destinationDirectory = project.rootDir
}
11 changes: 3 additions & 8 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
{
"mazes": [
{
"name": "zeta_big",
"type": "zeta",
"size": 60,
"name": "orthogonal",
"type": "orthogonal",
"size": 30,
"distanceMap": true,
"distanceMapStart": ["S", "S"]
}
],
"output": {
"format": "png",
"path": "testMazes/"
},
"style": {
"cellSize": 10,
"strokeWidth": 2,
"distanceMapColors": ["#ffffe0","#ffd298","#ffa574","#f67863","#e04c54","#bd1f38","#8b0000"]
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx1500m
org.gradle.configureondemand=false
org.gradle.configureondemand=false
3 changes: 3 additions & 0 deletions mazegen.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
java -jar mazegen.jar %*
pause

0 comments on commit a33f35a

Please sign in to comment.