Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open source prep 3: Signing and publishing #22

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ nb-configuration.xml
##############################
.DS_Store

##############################
## Environment
##############################
.env
51 changes: 50 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group 'com.viam'
version '0.0.1'
version '0.0.1-SNAPSHOT'

repositories {
google()
Expand All @@ -22,6 +22,7 @@ subprojects {
version = rootProject.version

apply plugin: 'maven-publish'
apply plugin: 'signing'

buildscript {
repositories {
Expand Down Expand Up @@ -68,6 +69,10 @@ subprojects {
return
}


def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'

if (project.plugins.hasPlugin("java")) {
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down Expand Up @@ -124,6 +129,30 @@ subprojects {
}
}
}
repositories {
maven {
name = "OSSRH"
credentials {
username = findProperty("ossrhUsername")
password = findProperty("ossrhPassword")
}
if (version.endsWith('SNAPSHOT') || version.contains('.alpha.') || version.contains('.beta.') || version.contains('.rc.')) {
url = snapshotsRepoUrl
} else {
url = releasesRepoUrl
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
if (project.plugins.hasPlugin("groovy-gradle-plugin")) {
sign publishing.publications.pluginMaven
} else {
sign publishing.publications.maven
}
}
}
if (project.plugins.hasPlugin("com.android.library")) {
Expand All @@ -139,6 +168,26 @@ subprojects {
}
}
}
repositories {
maven {
name = "OSSRH"
credentials {
username = findProperty("ossrhUsername")
password = findProperty("ossrhPassword")
}
if (version.endsWith('SNAPSHOT')) {
url = snapshotsRepoUrl
} else {
url = releasesRepoUrl
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions core/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ sourceSets {
}
}

java {
}

downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
Expand Down
2 changes: 1 addition & 1 deletion core/services/mlmodel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ java {
downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
}
}