-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add BOM #2049
Merged
Merged
Add BOM #2049
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there's any runtime-only dependencies, they should get runtime constraints too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good ticket to track - #2050