Skip to content

Commit

Permalink
Creating a fat jar for release
Browse files Browse the repository at this point in the history
  • Loading branch information
patbeagan1 committed Sep 20, 2021
1 parent c93dfe6 commit 91bc81d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.5.30"
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

sourceSets {
main.kotlin.srcDirs += 'src/main/kotlin'
main.java.srcDirs += 'src/main/java'
}

// region dependencies

repositories {
mavenCentral()
}

dependencies {
implementation 'junit:junit:4.12'
}

// endregion

tasks.test {
useJUnit()
}

tasks.test {
useJUnit()
}

tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.INHERIT
}

// region fatjar

group = "me.pbeagan"
version = "1.0-SNAPSHOT"

task buildMainJar(type: Jar) {
archiveBaseName.set("FamilyTreeGenerator")
exclude("META-INF/versions/9/module-info.class")
manifest {
attributes "Main-Class": "com.pbeagan.MainKt"
}

from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

// endregion

24 changes: 0 additions & 24 deletions build.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

rootProject.name = "untitled"
rootProject.name = "familyTreeGenerator"

3 changes: 1 addition & 2 deletions src/main/kotlin/com/pbeagan/io/Printer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ interface IPrinter {
}

class Printer : IPrinter {

override fun printProcessError(process: Process): Process {
process.errorStream.reader(Charsets.UTF_8).use { reader ->
println(reader.readText())
print(reader.readText())
}
return process
}
Expand Down
4 changes: 1 addition & 3 deletions src/test/kotlin/MainKtTest.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import com.pbeagan.ExternalProcessManager
import com.pbeagan.IExternalProcessManager
import com.pbeagan.Runtime
import com.pbeagan.entities.IPerson
import com.pbeagan.entities.Person
import com.pbeagan.io.FileManager
import com.pbeagan.io.IFileManager
import com.pbeagan.io.Printer
import com.pbeagan.providers.PersonProvider
import org.junit.Assert.assertEquals
import org.junit.Test
import java.io.File
import kotlin.random.Random
import kotlin.test.assertEquals

internal class MainKtTest {
@Test
Expand Down

0 comments on commit 91bc81d

Please sign in to comment.