add package uploading

This commit is contained in:
TopchetoEU 2025-01-24 02:45:26 +02:00
parent 1e982cd2ef
commit 6125772038
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
9 changed files with 39 additions and 10 deletions

View File

@ -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

View File

@ -9,4 +9,7 @@ java {
toolchain {
languageVersion = JavaLanguageVersion.of(17);
}
withJavadocJar();
withSourcesJar();
}

View File

@ -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<HttpHeaderAuthentication>("header");
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"]);
}
}
}

View File

@ -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));

View File

@ -175,7 +175,7 @@ public final class VariableList implements Iterable<Variable> {
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;

View File

@ -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

View File

@ -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);

View File

@ -429,7 +429,6 @@ public abstract class Value {
}
}
/** @internal */
public List<String> toReadableLines(Environment env, HashSet<ObjectValue> passed) {
return Arrays.asList(toString(env));
}

View File

@ -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");
include(":compilation");