-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e57e24b
commit fdbf13a
Showing
13 changed files
with
314 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
plugins { | ||
id 'io.deephaven.project.register' | ||
} | ||
|
||
description = 'Deephaven Bill of Materials' | ||
|
||
dependencies { | ||
constraints { constraint -> | ||
project.rootProject | ||
.subprojects | ||
.findAll { p -> io.deephaven.project.ProjectType.isPublic(p) } | ||
.each { p -> | ||
// TODO(deephaven-core#2050): Annotate some public dependencies with "runtime" constraint | ||
constraint.api p | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.deephaven.project.ProjectType=BOM_PUBLIC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import io.deephaven.project.util.PublishingConstants | ||
|
||
plugins { | ||
id 'java' | ||
id 'signing' | ||
|
@@ -17,119 +19,25 @@ tasks.withType(Javadoc) { | |
options.addStringOption('sourcepath', sourceSets.main.allJava.getSourceDirectories().getAsPath()) | ||
} | ||
|
||
def developerId = 'deephaven' | ||
def developerName = 'Deephaven Developers' | ||
def developerEmail = '[email protected]' | ||
|
||
def projectUrl = 'https://github.com/deephaven/deephaven-core' | ||
def orgName = 'Deephaven Data Labs' | ||
def orgUrl = 'https://deephaven.io/' | ||
|
||
def licenseName = ext.license.name | ||
def licenseUrl = ext.license.url | ||
|
||
def issuesSystem = 'GitHub Issues' | ||
def issuesUrl = 'https://github.com/deephaven/deephaven-core/issues' | ||
|
||
def scmUrl = 'https://github.com/deephaven/deephaven-core' | ||
def scmConnection = 'scm:git:git://github.com/deephaven/deephaven-core.git' | ||
def scmDevConnection = 'scm:git:ssh://github.com/deephaven/deephaven-core.git' | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
pom { | ||
url = projectUrl | ||
organization { | ||
name = orgName | ||
url = orgUrl | ||
} | ||
licenses { | ||
license { | ||
name = licenseName | ||
url = licenseUrl | ||
} | ||
} | ||
scm { | ||
url = scmUrl | ||
connection = scmConnection | ||
developerConnection = scmDevConnection | ||
} | ||
issueManagement { | ||
system = issuesSystem | ||
url = issuesUrl | ||
} | ||
developers { | ||
developer { | ||
id = developerId | ||
name = developerName | ||
email = developerEmail | ||
organization = orgName | ||
organizationUrl = orgUrl | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = 'ossrh' | ||
// ossrhUsername, ossrhPassword | ||
credentials(PasswordCredentials) | ||
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications.mavenJava | ||
String signingKey = findProperty("signingKey") | ||
String signingPassword = findProperty("signingPassword") | ||
if (signingKey != null && signingPassword != null) { | ||
// In CI, it's harder to pass a file; so if specified, we use the in-memory version. | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
} | ||
} | ||
|
||
def assertIsRelease = tasks.register('assertIsRelease') { | ||
it.doLast { | ||
if (System.getenv('CI') != 'true') { | ||
throw new IllegalStateException('Release error: env CI must be true') | ||
} | ||
def actualGithubRef = System.getenv('GITHUB_REF') | ||
def expectedGithubRef = "refs/heads/release/v${project.version}" | ||
if (actualGithubRef != expectedGithubRef) { | ||
throw new IllegalStateException("Release error: env GITHUB_REF '${actualGithubRef}' does not match expected '${expectedGithubRef}'. Bad tag? Bump version?") | ||
} | ||
} | ||
} | ||
|
||
// This is an extra safety checks to make sure we don't publish incorrectly | ||
publishMavenJavaPublicationToOssrhRepository.dependsOn(assertIsRelease) | ||
|
||
afterEvaluate { | ||
// https://central.sonatype.org/publish/requirements/ | ||
if (project.description == null) { | ||
throw new IllegalStateException("Project '${project.name}' is missing a description, which is required for publishing to maven central") | ||
} | ||
|
||
// The common-conventions plugin should take care of this, but we'll double-check here | ||
if (!project.archivesBaseName.contains('deephaven')) { | ||
throw new IllegalStateException("Project '${project.name}' archiveBaseName '${project.archivesBaseName}' does not contain 'deephaven'") | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = archivesBaseName | ||
pom { | ||
name = archivesBaseName | ||
description = project.description | ||
} | ||
} | ||
} | ||
} | ||
} | ||
PublishingConstants.setupRepositories(project) | ||
PublishingConstants.setupMavenPublication(project, publishing.publications.mavenJava) | ||
PublishingConstants.setupSigning(project, publishing.publications.mavenJava) |
33 changes: 33 additions & 0 deletions
33
buildSrc/src/main/groovy/io.deephaven.project.bom-public.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import io.deephaven.project.util.JavaDependencies | ||
import io.deephaven.project.util.PublishingConstants | ||
|
||
plugins { | ||
id 'io.deephaven.common-conventions' | ||
id 'java-platform' | ||
id 'maven-publish' | ||
id 'signing' | ||
} | ||
|
||
publishing { | ||
publications { | ||
myPlatform(MavenPublication) { | ||
from components.javaPlatform | ||
pom { | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
PublishingConstants.setupRepositories(project) | ||
PublishingConstants.setupMavenPublication(project, publishing.publications.myPlatform) | ||
PublishingConstants.setupSigning(project, publishing.publications.myPlatform) | ||
|
||
project.tasks | ||
.getByName('quick') | ||
.dependsOn JavaDependencies.verifyAllConfigurationsArePublicTask(project) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
import io.deephaven.project.ProjectType | ||
|
||
plugins { | ||
id 'io.deephaven.common-conventions' | ||
} | ||
|
||
def verifyAllProjectsRegistered = project.tasks.register('verifyAllProjectsRegistered') { task -> | ||
task.doLast { | ||
project.allprojects { Project p -> | ||
if (!ProjectType.isRegistered(p)) { | ||
throw new IllegalStateException("Project '${project.name}' has not registered. Please apply the plugin 'io.deephaven.project.register'.") | ||
} | ||
} | ||
} | ||
} | ||
|
||
project.tasks | ||
.getByName('quick') | ||
.dependsOn verifyAllProjectsRegistered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
buildSrc/src/main/groovy/io/deephaven/project/util/CombinedJavadoc.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.deephaven.project.util | ||
|
||
import groovy.transform.CompileStatic | ||
import io.deephaven.project.ProjectType | ||
import org.gradle.api.Project | ||
|
||
@CompileStatic | ||
class CombinedJavadoc { | ||
|
||
static boolean includeProject(Project p) { | ||
ProjectType type = ProjectType.getType(p) | ||
if (!type.isPublic) { | ||
return false | ||
} | ||
switch (type) { | ||
case ProjectType.BOM_PUBLIC: | ||
return false | ||
case ProjectType.JAVA_EXTERNAL: | ||
case ProjectType.JAVA_PUBLIC: | ||
return true | ||
default: | ||
throw new IllegalStateException("Unsure if public project type '${type}' is supposed to be included in combined-javadoc.") | ||
} | ||
} | ||
} |
Oops, something went wrong.