Skip to content

Commit

Permalink
Fix maven publish with Gradle 7
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Sep 16, 2021
1 parent 002631f commit 756ae43
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
10 changes: 6 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ dependencies {
implementation 'com.google.protobuf.nano:protobuf-javanano:3.2.0rc2'
}

publishing {
publications {
maven(MavenPublication) {
from components.all {}
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
}
}
10 changes: 6 additions & 4 deletions android/viroar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ tasks.whenTaskAdded { task ->
}
}

publishing {
publications {
maven(MavenPublication) {
from components.all {}
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
}
}
28 changes: 22 additions & 6 deletions android/virocore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:1.3.1"
implementation 'com.google.android.exoplayer:exoplayer:2.13.3'
implementation project(':libs:gvr')
implementation project(':libs:arcore')
api project(':libs:gvr')
api project(':libs:arcore')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.2.0rc2'
}

Expand All @@ -98,10 +98,26 @@ tasks.whenTaskAdded {
}
}

publishing {
publications {
maven(MavenPublication) {
from components.all {}
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
pom {
name = "viroCore"
description = "Community viroCore"
url = "https://github.com/ViroCommunity/virocore"
licenses {
license {
name = "MIT License"
url = "https://github.com/ViroCommunity/virocore/blob/main/LICENSE"
}
}
// TODO This fixes missing gvr dependency with Gradle 6.x but for Gradle 7.x it needs an other solution
// configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") }
// configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") }
}
}
}
}
}
10 changes: 6 additions & 4 deletions android/viroreact/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ tasks.whenTaskAdded { task ->
}
}

publishing {
publications {
maven(MavenPublication) {
from components.all {}
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
}
}

0 comments on commit 756ae43

Please sign in to comment.