Skip to content

Commit

Permalink
0.5.1 Correctly publish the -java-only artifact and the -headers arti…
Browse files Browse the repository at this point in the history
…fact

Summary:
Fixes #85

I've realized that 0.5.0 was published successfully, but the `fbjni-java-only` artifact and the `headers`
artifacts are missing. This is because the publishing plugin was not applied to the host build, and
changes on the maven publish plugin required a bit more changes on the build files.

I've fixed them all and verified on maven local that everything publishes correctly.

I'm also bumping the version to 0.5.1 to publish a new version.

Reviewed By: cipolleschi

Differential Revision: D47718649

fbshipit-source-id: bcc95fb6011867d61bbeac26c9f61b4149bf0e49
  • Loading branch information
cortinico authored and facebook-github-bot committed Jul 24, 2023
1 parent 7621c81 commit 8dc225a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
15 changes: 15 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,18 @@ dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.facebook.soloader:nativeloader:0.10.5'
}

task headersJar(type: Jar) {
archiveClassifier.set('headers')
from("$rootDir/cxx/") {
include '**/*.h'
}
}

publishing {
publications {
withType(MavenPublication).configureEach {
artifact(headersJar)
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# in the root directory of this source tree.

# POM publishing constants
VERSION_NAME=0.5.0
VERSION_NAME=0.5.1
GROUP=com.facebook.fbjni
SONATYPE_STAGING_PROFILE=comfacebook
SONATYPE_HOST=DEFAULT
Expand Down
23 changes: 19 additions & 4 deletions host.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'com.vanniktech.maven.publish' version '0.25.3' apply false
id 'com.vanniktech.maven.publish' version '0.25.3'
}

repositories {
Expand All @@ -41,6 +41,21 @@ dependencies {
testImplementation 'org.mockito:mockito-core:2.28.2'
}

// Overriding the artifacts name globally defined in gradle.properties
POM_PACKAGING = 'jar'
POM_ARTIFACT_ID = 'fbjni-java-only'
mavenPublishing {
coordinates(GROUP, "fbjni-java-only", VERSION_NAME)
}

task headersJar(type: Jar) {
archiveClassifier.set('headers')
from("$rootDir/cxx/") {
include '**/*.h'
}
}

publishing {
publications {
withType(MavenPublication).configureEach {
artifact(headersJar)
}
}
}

0 comments on commit 8dc225a

Please sign in to comment.