Skip to content

Commit

Permalink
+ full package
Browse files Browse the repository at this point in the history
  • Loading branch information
gciatto committed Nov 5, 2021
1 parent cffa538 commit 51892bb
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 33 deletions.
15 changes: 14 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import io.github.gciatto.kt.mpp.ProjectConfiguration.configureUploadToGithub
import io.github.gciatto.kt.mpp.ProjectExtensions.jsProjects
import io.github.gciatto.kt.mpp.ProjectExtensions.jvmProjects
import io.github.gciatto.kt.mpp.ProjectExtensions.ktProjects
Expand All @@ -9,6 +11,7 @@ plugins {
id("io.github.gciatto.kt-mpp-pp")
id("org.danilopianini.git-sensitive-semantic-versioning")
id("de.marcphilipp.nexus-publish")
id("com.github.johnrengelman.shadow")
}

group = "it.unibo.tuprolog"
Expand Down Expand Up @@ -80,6 +83,16 @@ kotlin {
}
}

val shadowJar by tasks.getting(ShadowJar::class) {
dependsOn("jvmMainClasses")
archiveBaseName.set(rootProject.name)
archiveClassifier.set("full")
from(kotlin.jvm().compilations.getByName("main").output)
from(files("${rootProject.projectDir}/LICENSE"))
}

configureUploadToGithub(shadowJar)

(ktProjects + jvmProjects + jsProjects + rootProject).forEach {
it.apply(plugin = "de.marcphilipp.nexus-publish")
it.nexusPublishing {
Expand All @@ -93,7 +106,7 @@ kotlin {
}
}

(ktProjects + jvmProjects).forEach {
(ktProjects + jvmProjects + rootProject).forEach {
it.tasks.withType<KotlinJvmCompile> {
val compatibility = kotlinOptions.jvmTarget
it.tasks.withType<JavaCompile> {
Expand Down
6 changes: 2 additions & 4 deletions ide-plp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ javafx {
val entryPoint = "it.unibo.tuprolog.ui.gui.PLPMain"

application {
mainClassName = entryPoint
mainClass.set(entryPoint)
}

val shadowJar = tasks.getByName<ShadowJar>("shadowJar") {
Expand All @@ -41,9 +41,7 @@ val shadowJar = tasks.getByName<ShadowJar>("shadowJar") {
sourceSets.main {
runtimeClasspath.filter { it.exists() }
.map { if (it.isDirectory) it else zipTree(it) }
.forEach {
from(it)
}
.forEach { from(it) }
}
from(files("${rootProject.projectDir}/LICENSE"))
dependsOn("classes")
Expand Down
6 changes: 2 additions & 4 deletions ide/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ javafx {
val entryPoint = "it.unibo.tuprolog.ui.gui.Main"

application {
mainClassName = entryPoint
mainClass.set(entryPoint)
}

val shadowJar = tasks.getByName<ShadowJar>("shadowJar") {
Expand All @@ -43,9 +43,7 @@ val shadowJar = tasks.getByName<ShadowJar>("shadowJar") {
sourceSets.main {
runtimeClasspath.filter { it.exists() }
.map { if (it.isDirectory) it else zipTree(it) }
.forEach {
from(it)
}
.forEach { from(it) }
}
from(files("${rootProject.projectDir}/LICENSE"))
dependsOn("classes")
Expand Down
5 changes: 1 addition & 4 deletions repl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ val shadowJar by tasks.getting(ShadowJar::class) {
dependsOn("jvmMainClasses")
archiveBaseName.set("${rootProject.name}-${project.name}")
archiveClassifier.set("redist")
configurations = listOf(
kotlin.jvm().compilations.getByName("main").compileDependencyFiles as Configuration
)
from(kotlin.jvm().compilations.getByName("main").output)
from(files("${rootProject.projectDir}/LICENSE"))
manifest {
Expand All @@ -47,7 +44,7 @@ tasks.create("run", JavaExec::class.java) {
kotlin.jvm().compilations.getByName("main").compileDependencyFiles
)
standardInput = System.`in`
main = mainKlass
mainClass.set(mainKlass)
arguments.let {
if (it != null) {
args = it.split("\\s+".toRegex()).filterNot { a -> a.isBlank() }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:JvmName("CLI")
@file:JvmName("PrologCLI")

package it.unibo.tuprolog

Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions src/jvmMain/java/it/unibo/tuprolog/ProblogIDE.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package it.unibo.tuprolog;

import it.unibo.tuprolog.ui.gui.PLPMain;

public class ProblogIDE {
public static void main(String[] args) {
PLPMain.main(args);
}
}
9 changes: 9 additions & 0 deletions src/jvmMain/java/it/unibo/tuprolog/PrologIDE.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package it.unibo.tuprolog;

import it.unibo.tuprolog.ui.gui.Main;

public class PrologIDE {
public static void main(String[] args) {
Main.main(args);
}
}
9 changes: 0 additions & 9 deletions src/jvmMain/kotlin/it/unibo/tuprolog/IDE.kt

This file was deleted.

9 changes: 0 additions & 9 deletions src/jvmMain/kotlin/it/unibo/tuprolog/PLPIDE.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:JvmName("CLI")
@file:JvmName("PrologCLI")

package it.unibo.tuprolog

Expand Down

0 comments on commit 51892bb

Please sign in to comment.