Skip to content

Commit

Permalink
Prepare to remove fat jar. (#13427)
Browse files Browse the repository at this point in the history
Set up the necessary docker publishing tasks to set us up to start publishing individual jars.

This is part of #13122 and is split out because that PR is too big and unwieldy.
  • Loading branch information
davinchia committed Jun 2, 2022
1 parent 7fbe6da commit d053600
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 39 deletions.
2 changes: 1 addition & 1 deletion airbyte-config/init/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java'
id 'java-library'
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion airbyte-config/specs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java'
id 'java-library'
}

dependencies {
Expand Down
65 changes: 28 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ plugins {
id 'maven-publish'
}

apply from: "$rootDir/publish-repositories.gradle"

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -167,6 +169,30 @@ def Task getDockerBuildTask(String artifactName, String projectDir, String build
})
}

@SuppressWarnings('GroovyAssignabilityCheck')
def Task getPublishArtifactsTask(String buildVersion, Project subproject) {
// generate a unique task name based on the directory name.
return task ("publishArtifact-$subproject.name" {
apply plugin: 'maven-publish'
publishing {
repositories {
publications {
"$subproject.name"(MavenPublication) {
from subproject.components.java

// use the subproject group and name with the assumption there are no identical subproject
// names, group names or subproject group/name combination.
groupId = "$subproject.group"
artifactId = "$subproject.name"
version = "$buildVersion"
repositories.add(rootProject.repositories.getByName('cloudrepo'))
}
}
}
}
})
}

allprojects {
apply plugin: 'com.bmuschko.docker-remote-api'

Expand Down Expand Up @@ -460,32 +486,9 @@ catalog {
}
}

//// TODO: Davin will turn this back on.
//// Configure what subprojects to publish.
//String[] toPublish = [
// ':airbyte-analytics',
// ':airbyte-api',
// ':airbyte-commons',
// ':airbyte-commons-docker',
// ':airbyte-config:init',
// ':airbyte-config:models',
// ':airbyte-config:persistence',
// ':airbyte-db:lib',
// ':airbyte-json-validation',
// ':airbyte-notification',
// ':airbyte-protocol:models',
// ':airbyte-scheduler:client',
// ':airbyte-scheduler:models',
// ':airbyte-scheduler:persistence',
// ':airbyte-server',
// ':airbyte-workers'
//]
//configure(subprojects.findAll { toPublish.contains(it.getPath()) }) {
// apply plugin: 'maven-publish'
//
publishing {
publications {
// This block is present so Gradle knows to publish a Maven jar.
// This block is present for dependency catalog publishing.
maven(MavenPublication) {
groupId = 'io.airbyte'
artifactId = 'oss-catalog'
Expand All @@ -495,17 +498,5 @@ publishing {
// e.g. the subproject :airbyte-scheduler:models is imported at io.airbyte.airbyte-config:persistence:<version-number>.
}
}

repositories {
maven {
url 'https://airbyte.mycloudrepo.io/repositories/airbyte-public-jars'
credentials {
name 'cloudrepo'
username System.getenv('CLOUDREPO_USER')
password System.getenv('CLOUDREPO_PASSWORD')
}
}

mavenLocal()
}
repositories.add(rootProject.repositories.getByName('cloudrepo'))
}
10 changes: 10 additions & 0 deletions publish-repositories.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repositories {
maven {
name = 'cloudrepo'
url = 'https://airbyte.mycloudrepo.io/repositories/airbyte-public-jars'
credentials {
username System.getenv('CLOUDREPO_USER')
password System.getenv('CLOUDREPO_PASSWORD')
}
}
}

0 comments on commit d053600

Please sign in to comment.