@@ -18,6 +18,7 @@ class AndroidMavenPluginIT extends Specification {
18
18
@Shared def buildDir = " ${ System.properties['buildDir']} "
19
19
20
20
@Rule final TemporaryFolder testProjectDir = new TemporaryFolder ()
21
+ List<File > pluginClasspath
21
22
22
23
File androidManifest
23
24
File settingsFile
@@ -32,6 +33,13 @@ class AndroidMavenPluginIT extends Specification {
32
33
settingsFile = testProjectDir. newFile(' settings.gradle' )
33
34
gradlePropertiesFile = testProjectDir. newFile(' gradle.properties' )
34
35
buildFile = testProjectDir. newFile(' build.gradle' )
36
+
37
+ def pluginClasspathResource = getClass(). classLoader. findResource(" plugin-classpath.txt" )
38
+ if (pluginClasspathResource == null ) {
39
+ throw new IllegalStateException (" Did not find plugin classpath resource, run `testClasses` build task." )
40
+ }
41
+
42
+ pluginClasspath = pluginClasspathResource. readLines(). collect { new File (it) }
35
43
}
36
44
37
45
@Unroll
@@ -47,6 +55,11 @@ class AndroidMavenPluginIT extends Specification {
47
55
48
56
gradlePropertiesFile << " org.gradle.jvmargs=-javaagent:${ jacocoRuntime} =destfile=${ buildDir} /jacoco/testKit-${ gradleVersion} .exec"
49
57
58
+ def classpathString = pluginClasspath
59
+ .collect { it. absolutePath. replace(' \\ ' , ' /' ) }
60
+ .collect { " '$it '" }
61
+ .join(" , " )
62
+
50
63
def uri = testProjectDir. root. toURI()
51
64
buildFile << """
52
65
buildscript {
@@ -60,14 +73,12 @@ class AndroidMavenPluginIT extends Specification {
60
73
61
74
dependencies {
62
75
classpath "com.android.tools.build:gradle:${ androidGradleBuildVersion} "
76
+ classpath files(${ classpathString} )
63
77
}
64
78
}
65
79
66
- plugins {
67
- id "com.github.dcendents.android-maven"
68
- }
69
-
70
80
apply plugin: 'com.android.library'
81
+ apply plugin: 'com.github.dcendents.android-maven'
71
82
72
83
group = 'org.test'
73
84
version = '1.0'
0 commit comments