Skip to content

Commit

Permalink
Overhaul the structure, bump the version to 0.1.0-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
finalchild committed Sep 5, 2020
1 parent 0fe05e9 commit db7ecf3
Show file tree
Hide file tree
Showing 18 changed files with 190 additions and 169 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build
on: push
jobs:
build:
name: build
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: '14'
- name: Build with Gradle
run: ./gradlew build
- name: Upload Actions Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: build/libs/
- name: Get Tag Name
uses: olegtarasov/get-tag@v2
id: tag_name
- name: Publish to Bintray
if: ${{ startsWith(steps.tag_name.outputs.tag, 'v') }}
run: ./gradlew bintrayUpload
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
- name: Create Release
if: ${{ startsWith(steps.tag_name.outputs.tag, 'v') }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_name.outputs.tag }}
release_name: ${{ steps.tag_name.outputs.tag }}
prerelease: ${{ contains(github.ref, '-') }}
- name: Upload Release Asset
if: ${{ startsWith(steps.tag_name.outputs.tag, 'v') }}
uses: AButler/[email protected]
with:
files: build/libs/*
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag_name.outputs.tag }}
108 changes: 81 additions & 27 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
plugins {
`java-library`
kotlin("jvm") version "1.4.0"
`java-library`
`maven-publish`
signing
id("com.jfrog.bintray") version "1.8.5"
}

group = "me.finalchild"
version = "0.0.1-SNAPSHOT"

description = "Kotlin object is plugin object."
version = "0.1.0-SNAPSHOT"
description = "kotlinc plugin for kopo"

repositories {
mavenCentral()
}

dependencies {
implementation(kotlin("stdlib"))
implementation(group="org.jetbrains.kotlin", name="kotlin-compiler-embeddable")
}

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
api(group="org.jetbrains.kotlin", name="kotlin-compiler-embeddable")
}

java {
Expand All @@ -28,46 +24,104 @@ java {
modularity.inferModulePath.set(true)
withSourcesJar()
}

tasks.compileJava {
inputs.property("moduleName", "me.finalchild.kopo")
dependsOn(tasks.compileKotlin)
inputs.property("moduleName", "me.finalchild.kopo.kotlinc")
options.encoding = "UTF-8"
destinationDir = tasks.compileKotlin.get().destinationDir
doFirst {
options.compilerArgs = listOf("--module-path", classpath.asPath)
classpath = files()
}
destinationDir = tasks.compileKotlin.get().destinationDir
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
tasks.compileKotlin {
kotlinOptions {
freeCompilerArgs = listOf("-progressive")
jvmTarget = "13"
jvmTarget = "14"
}
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
artifact(tasks["sourcesJar"])

pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/finalchild/kopo-kotlinc")
inceptionYear.set("2020")
url.set("https://github.com/finalchild/kopo")


organization {
name.set("Our Minecraft Space")
url.set("https://ourmc.space/")
}
licenses {
license {
name.set("ISC License")
url.set("https://opensource.org/licenses/isc-license.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("finalchild")
name.set("Final Child")
email.set("[email protected]")
url.set("https://github.com/finalchild")
organization.set("Our Minecraft Space")
organizationUrl.set("https://github.com/Our-Minecraft-Space")
roles.set(setOf("developer"))
timezone.set("Asia/Seoul")
}
}
scm {
connection.set("scm:git:https://github.com/finalchild/kopo-kotlinc.git")
developerConnection.set("scm:git:https://github.com/finalchild/kopo-kotlinc.git")
tag.set(if (!(project.version as String).endsWith("-SNAPSHOT")) {
"v${project.version}"
} else {
"HEAD"
})
url.set("https://github.com/finalchild/kopo-kotlinc")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/finalchild/kopo-kotlinc/issues")
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/finalchild/kopo-kotlinc/actions")
}
distributionManagement {
downloadUrl.set("https://github.com/fnialchild/kopo-kotlinc/releases")
}
}
}
}
repositories {
maven {
name = "heartpattern-repo"
url = if (project.version.toString().endsWith("-SNAPSHOT")) {
uri("https://maven.heartpattern.io/repository/finalchild-snapshots/")
}

signing {
useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
sign(publishing.publications["maven"])
}

bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
setPublications("maven")
publish = true
pkg.run {
repo = "Final_Repo"
name = project.name
version.run {
name = project.version as String
vcsTag = if (!(project.version as String).endsWith("-SNAPSHOT")) {
"v${project.version}"
} else {
uri("https://maven.heartpattern.io/repository/finalchild-releases/")
}
credentials {
username = project.findProperty("repo-username") as? String ?: System.getenv("REPO_USERNAME")
password = project.findProperty("repo-password") as? String? ?: System.getenv("REPO_PASSWORD")
null
}
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = "kopo"
rootProject.name = "kopo-kotlinc"

4 changes: 2 additions & 2 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module me.finalchild.kopo {
module me.finalchild.kopo.kotlinc {
requires kotlin.stdlib;
requires kotlin.compiler.embeddable;

exports me.finalchild.kopo;
exports me.finalchild.kopo.kotlinc;
}
36 changes: 0 additions & 36 deletions src/main/kotlin/me/finalchild/kopo/ClassBuilderClassVisitor.kt

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/kotlin/me/finalchild/kopo/KopoClassBuilder.kt

This file was deleted.

This file was deleted.

Loading

0 comments on commit db7ecf3

Please sign in to comment.