aboutsummaryrefslogtreecommitdiff
path: root/nativeruntime/build.gradle
blob: e784984abc42e798227d8cc78d06a0fce1cb1de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import groovy.json.JsonSlurper
import java.nio.charset.StandardCharsets
import org.robolectric.gradle.DeployedRoboJavaModulePlugin
import org.robolectric.gradle.RoboJavaModulePlugin

apply plugin: RoboJavaModulePlugin
apply plugin: DeployedRoboJavaModulePlugin

if (System.getenv('PUBLISH_NATIVERUNTIME_DIST_COMPAT') == "true") {
  apply plugin: 'maven-publish'
  apply plugin: "signing"

  publishing {
    publications {
      nativeRuntimeDist(MavenPublication) {
        artifact System.env["NATIVERUNTIME_DIST_COMPAT_JAR"]
        artifactId 'nativeruntime-dist-compat'
        version System.env["NATIVERUNTIME_DIST_COMPAT_VERSION"]

        pom {
          name = "Robolectric Nativeruntime Distribution Compat"
          description = "Robolectric Nativeruntime Distribution Compat"
          url = "https://source.android.com/"
          inceptionYear = "2008"
          licenses {
            license {
              name = "Apache 2.0"
              url = "http://www.apache.org/licenses/LICENSE-2.0"
              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."
              distribution = "repo"
            }
          }

          scm {
            url = "https://android.googlesource.com/platform/manifest.git"
            connection = "https://android.googlesource.com/platform/manifest.git"
          }

          developers {
            developer {
              name = "The Android Open Source Projects"
            }
          }
        }
      }
    }
    repositories {
      maven {
        url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

        credentials {
          username = System.properties["sonatype-login"] ?: System.env['SONATYPE_LOGIN']
          password = System.properties["sonatype-password"] ?: System.env['SONATYPE_PASSWORD']
        }
      }
    }
  }

  signing {
    sign publishing.publications.nativeRuntimeDist
  }
}

dependencies {
  api project(":utils")
  api project(":utils:reflector")
  api libs.guava

  implementation libs.robolectric.nativeruntime.dist.compat

  annotationProcessor libs.auto.service
  compileOnly libs.auto.service.annotations
  compileOnly AndroidSdk.MAX_SDK.coordinates

  testCompileOnly AndroidSdk.MAX_SDK.coordinates
  testRuntimeOnly AndroidSdk.MAX_SDK.coordinates
  testImplementation project(":robolectric")
  testImplementation libs.junit4
  testImplementation libs.truth
}