Skip to content

Commit

Permalink
Merge branch 'main' into run_build_on_main_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
breedx-splk authored Aug 14, 2023
2 parents c29e244 + fd55704 commit d3a1ad7
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,52 +1,70 @@
import com.android.build.api.dsl.LibraryExtension
import org.gradle.api.publish.maven.MavenPublication
import java.net.URI

plugins {
id("com.android.library")
id("maven-publish")
id("signing")
}

val isARelease = project.hasProperty("release") && project.property("release") == "true"

val variantToPublish = "release"
android {
lint {
warningsAsErrors = true
// A newer version of androidx.appcompat:appcompat than 1.3.1 is available: 1.4.1 [GradleDependency]
// we rely on dependabot for dependency updates
disable.add("GradleDependency")
}
}

val sourcesJar by tasks.registering(Jar::class) {

from(android.sourceSets.named("main").get().java.srcDirs)
archiveClassifier.set("sources")
}

project.afterEvaluate {

// note: we need to declare this here in afterEvaluate because the android plugin doesn't
// resolve dependencies early enough to make the libraryVariants hack work until here.
val javadoc by tasks.registering(Javadoc::class) {
source = android.sourceSets.named("main").get().java.getSourceFiles()
classpath += project.files(android.bootClasspath)
publishing {
singleVariant(variantToPublish) {

// grab the library variants, because apparently this is where the real classpath lives that
// is needed for javadoc generation.
val firstVariant = project.android.libraryVariants.toList().first()
val javaCompile = firstVariant.javaCompileProvider.get()
classpath += javaCompile.classpath
classpath += javaCompile.outputs.files
// Adding sources and javadoc artifacts only during a release.
if (isARelease) {
withJavadocJar()
withSourcesJar()
}
}
}
}

val javadocJar by tasks.registering(Jar::class) {
dependsOn(javadoc)
archiveClassifier.set("javadoc")
from(javadoc.get().destinationDir)
}
afterEvaluate {
publishing.publications {
val maven = create<MavenPublication>("maven") {
from(components.findByName(variantToPublish))
pom {
val repoUrl = "https://github.com/open-telemetry/opentelemetry-android"
name.set("OpenTelemetry Android")
description.set(project.description)
url.set(repoUrl)
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
val scmUrl = "scm:git:[email protected]:open-telemetry/opentelemetry-android.git"
connection.set(scmUrl)
developerConnection.set(scmUrl)
url.set(repoUrl)
tag.set("HEAD")
}
developers {
developer {
id.set("opentelemetry")
name.set("OpenTelemetry")
url.set("https://github.com/open-telemetry/community")
}
}
}
}

val component = project.components.findByName("release")
publishing {
publications {
// Signing only during a release.
if (isARelease) {
signing.sign(maven)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {

dependencies {
errorprone("com.uber.nullaway:nullaway:0.10.12")
errorprone("com.google.errorprone:error_prone_core:2.15.0")
errorprone("com.google.errorprone:error_prone_core:2.21.1")
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
}

Expand Down
6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.

22 changes: 22 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"packageRules": [
{
// navigation-fragment 2.7.0 and above require android api 34+, which we are not ready for
// yet due to android gradle plugin only supporting min 33.
"matchPackagePrefixes": ["androidx.navigation"],
"matchUpdateTypes": ["major", "minor"],
"enabled": false
},
{
// navigation-fragment 2.7.0 and above require android api 34+, which we are not ready for
// yet due to android gradle plugin only supporting min 33.
"matchPackageNames": ["androidx.browser:browser"],
"matchUpdateTypes": ["major", "minor"],
"enabled": false
}
]
}

0 comments on commit d3a1ad7

Please sign in to comment.