-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change build script language from groovy to kotlin
- Loading branch information
1 parent
3eeffa4
commit f7c896f
Showing
13 changed files
with
190 additions
and
113 deletions.
There are no files selected for viewing
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,6 +1,9 @@ | ||
# toy-brick-fx | ||
Our utilities for javafx. | ||
# toy-brick | ||
|
||
It is a framework-like utility. All codes are from my personal javafx project. | ||
> The original `toy-brick-fx` repository was renamed into `toy-brick` now | ||
Our utilities for java GUI applications. | ||
|
||
It is a framework-like utility. All codes are from my personal java GUI projects. | ||
It was planed to being migrating more utilities, features or concepts from my personal projects. | ||
|
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,76 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
id("java") | ||
kotlin("jvm") version "1.7.10" apply false | ||
} | ||
|
||
allprojects { | ||
group = "com.shinonometn" | ||
version = "1.1-SNAPSHOT" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url = uri("https://nexus.shinonometn.com/repository/shinonometn-repo/") | ||
} | ||
} | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "java") | ||
apply(plugin = "kotlin") | ||
|
||
if(!project.name.endsWith("-demo")) { | ||
apply(plugin = "maven-publish") | ||
} | ||
|
||
dependencies { | ||
implementation("com.fasterxml.jackson.core:jackson-databind:2.10.1") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") | ||
testImplementation(kotlin("test")) | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "11" | ||
} | ||
} | ||
|
||
//import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
// | ||
//plugins { | ||
// kotlin("jvm") version "1.7.0" | ||
// id("org.openjfx.javafxplugin") version "0.0.8" apply false | ||
//} | ||
// | ||
// | ||
//subprojects { | ||
// | ||
// publishing { | ||
// repositories { | ||
// maven { | ||
// name = "shinonometn" | ||
// | ||
// def releasesRepoUrl = "https://nexus.shinonometn.com/repository/maven-releases/" | ||
// def snapshotsRepoUrl = "https://nexus.shinonometn.com/repository/maven-snapshots/" | ||
// url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl | ||
// | ||
// credentials { | ||
// // Stored in ~/.gradle/gradle.properties | ||
// username "$mavenUsername" | ||
// password "$mavenPassword" | ||
// } | ||
// } | ||
// } | ||
// | ||
// publications { | ||
// maven(MavenPublication) { | ||
// from(components.java) | ||
// } | ||
// } | ||
// } | ||
//} |
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,2 @@ | ||
/.gradle | ||
/build |
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,26 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
kotlin("jvm") version "1.7.0" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(localGroovy()) | ||
|
||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
buildSrc/src/main/kotlin/com/shinonometn/toybrick/build/PublishUtils.kt
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,27 @@ | ||
package com.shinonometn.toybrick.build | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.publish.PublishingExtension | ||
import org.gradle.api.publish.maven.MavenPublication | ||
|
||
fun Project.publishToShinonomeTN(publishing: PublishingExtension) = with(publishing) { | ||
repositories { repos -> | ||
repos.maven { maven -> | ||
maven.name = "shinonometn" | ||
val releasesUrl = uri("https://nexus.shinonometn.com/repository/maven-releases/") | ||
val snapshotsUrl = uri("https://nexus.shinonometn.com/repository/maven-snapshots/") | ||
maven.url = if (project.version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl | ||
|
||
maven.credentials { credentials -> | ||
credentials.username = System.getenv("MAVEN_USERNAME") | ||
credentials.password = System.getenv("MAVEN_PASSWORD") | ||
} | ||
} | ||
} | ||
|
||
publications { container -> | ||
container.create("maven", MavenPublication::class.java) { mvnPub -> | ||
mvnPub.from(components.getByName("java")) | ||
} | ||
} | ||
} |
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,8 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
rootProject.name = "toy-brick" | ||
|
||
include( | ||
":toy-brick-fx", ":toy-brick-fx-demo" | ||
) |
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,16 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
plugins { | ||
id("application") | ||
} | ||
|
||
application { | ||
|
||
} | ||
|
||
//mainClassName="com.shinonometn.fx.demo.MainKt" | ||
|
||
dependencies { | ||
implementation(project(":toy-brick-fx")) | ||
} |
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,26 @@ | ||
import com.shinonometn.toybrick.build.publishToShinonomeTN | ||
|
||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
|
||
plugins { | ||
id("org.openjfx.javafxplugin") version "0.0.13" | ||
} | ||
|
||
javafx { | ||
version = "11.0.2" | ||
modules = listOf( | ||
"javafx.controls", | ||
"javafx.graphics", | ||
"javafx.fxml", | ||
"javafx.web", | ||
"javafx.media" | ||
) | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-javafx:1.6.4") | ||
} | ||
|
||
publishToShinonomeTN(publishing) |