diff options
author | Xavier Ducrohet <xav@android.com> | 2012-10-04 16:07:22 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-10-04 16:39:59 -0700 |
commit | d14ea2c706561925d45feb30a1b57732bcefc383 (patch) | |
tree | 656bf1405b3abe7026c0b5abe07c48a14cda391e /builder/src/test | |
parent | 8428cf7c046c051ff7c60cee614c31691d664463 (diff) | |
download | build-d14ea2c706561925d45feb30a1b57732bcefc383.tar.gz |
Use custom SourceSet instead of default Java ones.
Fixed a couple of path-related issue to make it
work on Windows.
Replaced "customized" test app with "migrated" that uses
the folder structure of older projects and reconfigure
it through the source sets.
Change-Id: Ibb1e81ef7272c3ca8e766c17b5a105d69be98c51
Diffstat (limited to 'builder/src/test')
-rw-r--r-- | builder/src/test/java/com/android/builder/MockSourceProvider.java (renamed from builder/src/test/java/com/android/builder/MockSourceSet.java) | 30 | ||||
-rw-r--r-- | builder/src/test/java/com/android/builder/VariantConfigurationTest.java | 12 |
2 files changed, 15 insertions, 27 deletions
diff --git a/builder/src/test/java/com/android/builder/MockSourceSet.java b/builder/src/test/java/com/android/builder/MockSourceProvider.java index 2d2c174..1fb4fe1 100644 --- a/builder/src/test/java/com/android/builder/MockSourceSet.java +++ b/builder/src/test/java/com/android/builder/MockSourceProvider.java @@ -17,57 +17,45 @@ package com.android.builder; import java.io.File; -import java.util.Collections; -import java.util.Set; /** - * Implementation of SourceSet for testing that provides the default convention paths. + * Implementation of SourceProvider for testing that provides the default convention paths. */ -class MockSourceSet implements SourceSet { +class MockSourceProvider implements SourceProvider { - public MockSourceSet(String root) { + public MockSourceProvider(String root) { mRoot = root; } private final String mRoot; @Override - public Set<File> getJavaResources() { - return Collections.singleton(new File(mRoot, "resources")); - } - - @Override - public Iterable<File> getCompileClasspath() { - return null; - } - - @Override - public File getAndroidResources() { + public File getResourcesDir() { return new File(mRoot, "res"); } @Override - public File getAndroidAssets() { + public File getAssetsDir() { return new File(mRoot, "assets"); } @Override - public File getAndroidManifest() { + public File getManifestFile() { return new File(mRoot, "AndroidManifest.xml"); } @Override - public File getAidlSource() { + public File getAidlDir() { return new File(mRoot, "aidl"); } @Override - public File getRenderscriptSource() { + public File getRenderscriptDir() { return new File(mRoot, "rs"); } @Override - public File getNativeSource() { + public File getJniDir() { return new File(mRoot, "jni"); } } diff --git a/builder/src/test/java/com/android/builder/VariantConfigurationTest.java b/builder/src/test/java/com/android/builder/VariantConfigurationTest.java index 2e0e889..ee3af55 100644 --- a/builder/src/test/java/com/android/builder/VariantConfigurationTest.java +++ b/builder/src/test/java/com/android/builder/VariantConfigurationTest.java @@ -95,8 +95,8 @@ public class VariantConfigurationTest extends TestCase { private VariantConfiguration getVariant() { VariantConfiguration variant = new VariantConfiguration( - mDefaultConfig, new MockSourceSet("main"), - mBuildType, new MockSourceSet("debug"), + mDefaultConfig, new MockSourceProvider("main"), + mBuildType, new MockSourceProvider("debug"), VariantConfiguration.Type.DEFAULT) { // don't do validation. @Override @@ -105,15 +105,15 @@ public class VariantConfigurationTest extends TestCase { } }; - variant.addProductFlavor(mFlavorConfig, new MockSourceSet("custom")); + variant.addProductFlavor(mFlavorConfig, new MockSourceProvider("custom")); return variant; } private VariantConfiguration getVariantWithManifestPackage(final String packageName) { VariantConfiguration variant = new VariantConfiguration( - mDefaultConfig, new MockSourceSet("main"), - mBuildType, new MockSourceSet("debug"), + mDefaultConfig, new MockSourceProvider("main"), + mBuildType, new MockSourceProvider("debug"), VariantConfiguration.Type.DEFAULT) { @Override public String getPackageFromManifest() { @@ -126,7 +126,7 @@ public class VariantConfigurationTest extends TestCase { } }; - variant.addProductFlavor(mFlavorConfig, new MockSourceSet("custom")); + variant.addProductFlavor(mFlavorConfig, new MockSourceProvider("custom")); return variant; } } |