diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 2e91459..0bfde53 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -25,10 +25,14 @@ jobs: gradle-version: "8.10" - name: Build run: gradle build + - name: Publish + run: gradle publish + env: + ACCESS_TOKEN: "${{github.token}}" + REPO_URL: "${{github.api_url}}/packages/${{github.repository_owner}}/maven" - name: Create release uses: "https://gitea.com/actions/gitea-release-action@main" with: - # api_key: "${{secrets.TOKEN}}" files: | LICENSE build/libs/*.jar \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/common-java.gradle.kts b/buildSrc/src/main/kotlin/common-java.gradle.kts index d243fb2..81e491c 100644 --- a/buildSrc/src/main/kotlin/common-java.gradle.kts +++ b/buildSrc/src/main/kotlin/common-java.gradle.kts @@ -9,4 +9,7 @@ java { toolchain { languageVersion = JavaLanguageVersion.of(17); } + + withJavadocJar(); + withSourcesJar(); } diff --git a/buildSrc/src/main/kotlin/common.gradle.kts b/buildSrc/src/main/kotlin/common.gradle.kts index 8a784a3..2577f0a 100644 --- a/buildSrc/src/main/kotlin/common.gradle.kts +++ b/buildSrc/src/main/kotlin/common.gradle.kts @@ -1,5 +1,6 @@ plugins { id("java"); + id("maven-publish"); } version = rootProject.version; @@ -20,3 +21,27 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter:5.9.2"); testRuntimeOnly("org.junit.platform:junit-platform-launcher"); } + + +publishing { + repositories { + maven { + name = "Gitea"; + url = uri(System.getenv("REPO_URL") ?: ""); + + credentials(HttpHeaderCredentials::class) { + name = "Authorization"; + value = "token ${System.getenv("ACCESS_TOKEN")}"; + } + + authentication { + create("header"); + } + } + } + publications { + create("maven") { + from(components["java"]); + } + } +} diff --git a/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java b/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java index bb5ebee..de84687 100644 --- a/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java +++ b/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/FunctionScope.java @@ -32,7 +32,7 @@ public final class FunctionScope { } /** - * @returns If a variable with the same name exists, the old variable. Otherwise, the given variable + * @return If a variable with the same name exists, the old variable. Otherwise, the given variable */ public Variable define(Variable var) { if (passthrough) return null; @@ -48,7 +48,7 @@ public final class FunctionScope { } /** - * @returns A variable with the given name, or null if a global variable + * @return A variable with the given name, or null if a global variable */ public Variable define(String name) { return define(new Variable(name, false)); diff --git a/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java b/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java index 20febba..bb15f38 100644 --- a/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java +++ b/compilation/src/main/java/me/topchetoeu/j2s/compilation/scope/VariableList.java @@ -175,7 +175,7 @@ public final class VariableList implements Iterable { this.offset = () -> offset; } /** - * @param offset Will offset the indices by the size of the given list + * @param prev Will offset the indices by the size of the given list */ public VariableList(IndexType type, VariableList prev) { this.indexType = type; diff --git a/gradle.properties b/gradle.properties index f8ee4ec..9f47de2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -project_group = me.topchetoeu +project_group = me.topchetoeu.j2s project_name = j2s project_version = 0.10.5-beta main_class = me.topchetoeu.j2s.repl.SimpleRepl diff --git a/runtime/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java b/runtime/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java index c756676..bb677a7 100644 --- a/runtime/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java +++ b/runtime/src/main/java/me/topchetoeu/j2s/runtime/debug/DebugHandler.java @@ -31,8 +31,6 @@ public interface DebugHandler { * Called when a script has been loaded * @param filename The name of the source * @param source The name of the source - * @param breakpoints A set of all the breakpointable locations in this source - * @param map The source map associated with this file. null if this source map isn't mapped */ public void onSourceLoad(Filename filename, String source); diff --git a/runtime/src/main/java/me/topchetoeu/j2s/runtime/values/Value.java b/runtime/src/main/java/me/topchetoeu/j2s/runtime/values/Value.java index 13adc3e..192e1b7 100644 --- a/runtime/src/main/java/me/topchetoeu/j2s/runtime/values/Value.java +++ b/runtime/src/main/java/me/topchetoeu/j2s/runtime/values/Value.java @@ -429,7 +429,6 @@ public abstract class Value { } } - /** @internal */ public List toReadableLines(Environment env, HashSet passed) { return Arrays.asList(toString(env)); } diff --git a/settings.gradle.kts b/settings.gradle.kts index f66048b..65549f7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,10 +9,10 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"; } -// rootProject.name = properties.project_name; +rootProject.name = extra.properties["project_name"].toString(); include(":lib"); include(":common"); include(":repl"); include(":runtime"); -include(":compilation"); \ No newline at end of file +include(":compilation");