@@ -10,16 +10,46 @@ configurations {
10
10
11
11
repositories {
12
12
mavenCentral()
13
- jcenter() // https://youtrack.jetbrains.com/issue/IDEA-261387
14
13
}
14
+
15
+ val artifactType = Attribute .of(" artifactType" , String ::class .java)
16
+ val unpackedAar = Attribute .of(" unpackedAar" , Boolean ::class .javaObjectType)
17
+
18
+ configurations.configureEach {
19
+ afterEvaluate {
20
+ if (isCanBeResolved) {
21
+ attributes.attribute(unpackedAar, true ) // request all AARs to be unpacked
22
+ }
23
+ }
24
+ }
25
+
15
26
dependencies {
27
+ attributesSchema {
28
+ attribute(unpackedAar)
29
+ }
30
+
31
+ artifactTypes {
32
+ create(" aar" ) {
33
+ attributes.attribute(unpackedAar, false )
34
+ }
35
+ }
36
+
37
+ registerTransform(UnpackAar ::class .java) {
38
+ from.attribute(unpackedAar, false ).attribute(artifactType, " aar" )
39
+ to.attribute(unpackedAar, true ).attribute(artifactType, " jar" )
40
+ }
41
+
16
42
compileOnly(" com.google.android:android:${version(" android" )} " )
17
43
compileOnly(" androidx.annotation:annotation:${version(" androidx_annotation" )} " )
18
44
19
45
testImplementation(" com.google.android:android:${version(" android" )} " )
20
46
testImplementation(" org.robolectric:robolectric:${version(" robolectric" )} " )
21
- testImplementation(" org.smali:baksmali:${version(" baksmali" )} " )
47
+ // Required by robolectric
48
+ testImplementation(" androidx.test:core:1.2.0" )
49
+ testImplementation(" androidx.test:monitor:1.2.0" )
50
+
22
51
52
+ testImplementation(" org.smali:baksmali:${version(" baksmali" )} " )
23
53
" r8" (" com.android.tools.build:builder:7.1.0-alpha01" )
24
54
}
25
55
0 commit comments