-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from gradle/tt/support-android-test-projects
Add support for android-test projects for NiA benchmarks
- Loading branch information
Showing
13 changed files
with
295 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...lugin-android/src/main/java/org/gradle/api/experimental/android/ExperimentalProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.gradle.api.experimental.android; | ||
|
||
import org.gradle.api.Named; | ||
import org.gradle.api.provider.Property; | ||
import org.gradle.declarative.dsl.model.annotations.Restricted; | ||
|
||
@Restricted | ||
public interface ExperimentalProperty extends Named { | ||
@Restricted | ||
Property<Boolean> getValue(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...d/src/main/java/org/gradle/api/experimental/android/extensions/testing/ManagedDevice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.gradle.api.experimental.android.extensions.testing; | ||
|
||
import org.gradle.api.Named; | ||
import org.gradle.api.provider.Property; | ||
import org.gradle.declarative.dsl.model.annotations.Restricted; | ||
|
||
@Restricted | ||
public interface ManagedDevice extends Named { | ||
@Restricted | ||
abstract Property<String> getDevice(); | ||
|
||
@Restricted | ||
abstract Property<Integer> getApiLevel(); | ||
|
||
@Restricted | ||
abstract Property<String> getSystemImageSource(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...in/plugin-android/src/main/java/org/gradle/api/experimental/android/test/AndroidTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package org.gradle.api.experimental.android.test; | ||
|
||
import com.android.build.api.dsl.BaseFlavor; | ||
import com.android.build.api.dsl.CommonExtension; | ||
import org.gradle.api.Action; | ||
import org.gradle.api.NamedDomainObjectContainer; | ||
import org.gradle.api.experimental.android.ExperimentalProperty; | ||
import org.gradle.api.experimental.android.extensions.BaselineProfile; | ||
import org.gradle.api.experimental.android.extensions.testing.AndroidTestDependencies; | ||
import org.gradle.api.experimental.android.extensions.testing.TestOptions; | ||
import org.gradle.api.provider.Property; | ||
import org.gradle.api.tasks.Nested; | ||
import org.gradle.declarative.dsl.model.annotations.Configuring; | ||
import org.gradle.declarative.dsl.model.annotations.Restricted; | ||
|
||
// TODO: This probably shouldn't extend AndroidSoftware, as it does not | ||
// represent a project the produces production software. There should be a | ||
// common AbstractAndroidPlugin that AndroidSoftwarePlugin and this plugin | ||
// both extend that folds these commonalities back into it | ||
public interface AndroidTest { | ||
/** | ||
* @see CommonExtension#getNamespace() | ||
*/ | ||
@Restricted | ||
Property<String> getNamespace(); | ||
|
||
/** | ||
* @see CommonExtension#getCompileSdk() | ||
*/ | ||
@Restricted | ||
Property<Integer> getCompileSdk(); | ||
|
||
/** | ||
* @see BaseFlavor#getMinSdk() | ||
*/ | ||
@Restricted | ||
Property<Integer> getMinSdk(); | ||
|
||
@Restricted | ||
Property<Integer> getTargetSdk(); | ||
|
||
/** | ||
* Flag to enable/disable generation of the `BuildConfig` class. | ||
* | ||
* Default value is `false`. | ||
*/ | ||
@Restricted | ||
Property<Boolean> getBuildConfig(); | ||
|
||
@Nested | ||
BaselineProfile getBaselineProfile(); | ||
|
||
@Configuring | ||
default void baselineProfile(Action<? super BaselineProfile> action) { | ||
action.execute(getBaselineProfile()); | ||
} | ||
|
||
@Nested | ||
NamedDomainObjectContainer<ExperimentalProperty> getExperimentalProperties(); | ||
|
||
@Nested | ||
AndroidTestDependencies getDependencies(); | ||
|
||
@Configuring | ||
default void dependencies(Action<? super AndroidTestDependencies> action) { | ||
action.execute(getDependencies()); | ||
} | ||
|
||
@Nested | ||
TestOptions getTestOptions(); | ||
|
||
@Configuring | ||
default void testOptions(Action<? super TestOptions> action) { | ||
action.execute(getTestOptions()); | ||
} | ||
|
||
@Restricted | ||
Property<String> getTargetProjectPath(); | ||
} |
Oops, something went wrong.