• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import groovy.json.JsonSlurper
2import java.nio.charset.StandardCharsets
3import org.robolectric.gradle.DeployedRoboJavaModulePlugin
4import org.robolectric.gradle.RoboJavaModulePlugin
5
6apply plugin: RoboJavaModulePlugin
7apply plugin: DeployedRoboJavaModulePlugin
8
9if (System.getenv('PUBLISH_NATIVERUNTIME_DIST_COMPAT') == "true") {
10  apply plugin: 'maven-publish'
11  apply plugin: "signing"
12
13  publishing {
14    publications {
15      nativeRuntimeDist(MavenPublication) {
16        artifact System.env["NATIVERUNTIME_DIST_COMPAT_JAR"]
17        artifactId 'nativeruntime-dist-compat'
18        version System.env["NATIVERUNTIME_DIST_COMPAT_VERSION"]
19
20        pom {
21          name = "Robolectric Nativeruntime Distribution Compat"
22          description = "Robolectric Nativeruntime Distribution Compat"
23          url = "https://source.android.com/"
24          inceptionYear = "2008"
25          licenses {
26            license {
27              name = "Apache 2.0"
28              url = "http://www.apache.org/licenses/LICENSE-2.0"
29              comments = "While the EULA for the Android SDK restricts distribution of those binaries, the source code is licensed under Apache 2.0 which allows compiling binaries from source and then distributing those versions."
30              distribution = "repo"
31            }
32          }
33
34          scm {
35            url = "https://android.googlesource.com/platform/manifest.git"
36            connection = "https://android.googlesource.com/platform/manifest.git"
37          }
38
39          developers {
40            developer {
41              name = "The Android Open Source Projects"
42            }
43          }
44        }
45      }
46    }
47    repositories {
48      maven {
49        url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
50
51        credentials {
52          username = System.properties["sonatype-login"] ?: System.env['SONATYPE_LOGIN']
53          password = System.properties["sonatype-password"] ?: System.env['SONATYPE_PASSWORD']
54        }
55      }
56    }
57  }
58
59  signing {
60    sign publishing.publications.nativeRuntimeDist
61  }
62}
63
64dependencies {
65  api project(":utils")
66  api project(":utils:reflector")
67  api libs.guava
68
69  implementation libs.robolectric.nativeruntime.dist.compat
70
71  annotationProcessor libs.auto.service
72  compileOnly libs.auto.service.annotations
73  compileOnly AndroidSdk.MAX_SDK.coordinates
74
75  testCompileOnly AndroidSdk.MAX_SDK.coordinates
76  testRuntimeOnly AndroidSdk.MAX_SDK.coordinates
77  testImplementation project(":robolectric")
78  testImplementation libs.junit4
79  testImplementation libs.truth
80}
81