Skip to content

Commit

Permalink
feat: add publish metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
doinkythederp committed Nov 19, 2024
1 parent d6193c8 commit cde4958
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 23 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 vexide Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 45 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,68 @@ plugins {
`java-library`
`maven-publish`
id("org.teavm.library").version("0.10.2")
id("hydrozoa").apply(false)
id("dev.vexide.hydrozoa").apply(false)
}

group = "dev.vexide"
version = "0.1.0"

subprojects {
plugins.apply("hydrozoa")
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
name = "Hydrozoa"
description = "Create VEX V5 robot programs in Java and Kotlin"
inceptionYear = "2024"
url = "https://vexide.dev"
licenses {
license {
name = "The MIT License"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
connection = "scm:git:git://github.com/vexide/Hydrozoa-Java.git"
developerConnection = "scm:git:ssh://github.com/vexide/Hydrozoa-Java.git"
url = "https://github.com/vexide/Hydrozoa-Java"
}
}
from(components["java"])
}
}
}

allprojects {
plugins.apply("maven-publish")
plugins.apply("java")
publishing {
repositories {
maven {
name = "localMavenRepository"
url = project.rootProject.uri("../local-maven-repository")
}
}
}

group = project.group
version = project.version
java {
withSourcesJar()
withJavadocJar()

sourceCompatibility = JavaVersion.VERSION_21
}

repositories {
mavenCentral()
}
}

repositories {
mavenCentral()
subprojects {
group = project.rootProject.group
version = project.rootProject.version
}

dependencies {
implementation("org.jetbrains:annotations:24.0.0")

implementation(project(":vex-sdk"))
}

java {
withSourcesJar()
withJavadocJar()

sourceCompatibility = JavaVersion.VERSION_21
}
4 changes: 0 additions & 4 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ subprojects {
// Add Hydrozoa SDK from project root
implementation(project(":"))
}

hydrozoa {
runtime = project.parent!!.parent!!.layout.projectDirectory.file("runtime.bin")
}
}
2 changes: 2 additions & 0 deletions examples/clawbot-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
plugins {
kotlin("jvm") version "1.9.20"
id("dev.vexide.hydrozoa")
}

hydrozoa {
entrypoint = "dev.vexide.hydrozoa.clawbotkt.Main"
runtime = project.rootProject.layout.projectDirectory.file("runtime.bin")
}

kotlin {
Expand Down
5 changes: 5 additions & 0 deletions examples/clawbot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
plugins {
id("dev.vexide.hydrozoa")
}

hydrozoa {
entrypoint = "dev.vexide.hydrozoa.clawbot.Main"
runtime = project.rootProject.layout.projectDirectory.file("runtime.bin")
}
20 changes: 17 additions & 3 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
`kotlin-dsl`
id("com.gradle.plugin-publish") version "1.2.1"
}

group = "dev.vexide"
Expand All @@ -14,10 +15,23 @@ dependencies {
}

gradlePlugin {
website = "https://github.com/vexide/Hydrozoa-Java/tree/main/gradle-plugin"
vcsUrl = "https://github.com/vexide/Hydrozoa-Java.git"
plugins {
create("HydrozoaPlugin") {
id = "hydrozoa"
implementationClass = "dev.vexide.hydrozoa.HydrozoaPlugin"
matching { it.name == "dev.vexide.hydrozoa" }.configureEach {
id = "dev.vexide.hydrozoa"
displayName = "Hydrozoa Gradle plugin"
description = "Build & upload Gradle projects to VEX V5 robots"
tags = listOf("vex", "robot", "robotics", "v5", "vexide", "hydrozoa")
}
}
}

publishing {
repositories {
maven {
name = "localPluginRepository"
url = uri("../../local-plugin-repository")
}
}
}
1 change: 1 addition & 0 deletions gradle-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "hydrozoa"
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
rootProject.name = "vex-java-project"
rootProject.name = "hydrozoa"

includeBuild("gradle-plugin")

include("vex-sdk")
findProject("vex-sdk")?.name = "vex-sdk"

include("examples:clawbot")
findProject(":examples:clawbot")?.name = "clawbot"
Expand Down
34 changes: 34 additions & 0 deletions vex-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
plugins {
`java-library`
`maven-publish`
id("org.teavm.library")
}


tasks.jar {
manifest {
attributes("Automatic-Module-Name" to "dev.vexide.hydrozoa.sdk")
}
}

publishing {
publications {
create<MavenPublication>("mavenJavaVexSdk") {
pom {
name = "Hydrozoa VEX SDK"
description = "Access low-level VEX V5 hardware features"
inceptionYear = "2024"
url = "https://vexide.dev"
licenses {
license {
name = "The MIT License"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
connection = "scm:git:git://github.com/vexide/Hydrozoa-Java.git"
developerConnection = "scm:git:ssh://github.com/vexide/Hydrozoa-Java.git"
url = "https://github.com/vexide/Hydrozoa-Java"
}
}
from(components["java"])
}
}
}


dependencies {
implementation("org.jetbrains:annotations:24.0.0")

implementation(teavm.libs.interop)
}

0 comments on commit cde4958

Please sign in to comment.