summaryrefslogtreecommitdiff
path: root/android/testData
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2014-08-05 17:46:09 -0700
committerSiva Velusamy <vsiva@google.com>2014-08-05 17:56:24 -0700
commit261b2fe692c401e9b79619a7b89a4d688f6b92ed (patch)
treeb8ba797f49f81560825e75a858dd3d1f0d874d24 /android/testData
parent87d28ed8e3100d8e2287069c6544a67a0379dc3c (diff)
downloadidea-261b2fe692c401e9b79619a7b89a4d688f6b92ed.tar.gz
navigator: Handle overlapping source sets
Gradle projects, especially those migrated from Eclipse contain overlapping source sets for different source types. e.g.: java.srcDirs = ['src'] aidl.srcDirs = ['src'] resources.srcDirs = ['src', 'resources'] Currently, this will show up as separate nodes (java, aidl and resources), with all of them showing the sources within their source folders. This is not only odd, but causes issues where the navigator would expand multiple nodes seemingly randomly when expanding a particular node. This happens because we have a single folder present in multiple locations inside the tree. This CL improves this scenario by: - If the source roots for a particular source type is a subset of a previously shown source type's roots, then we just don't show this source type. e.g. in the above case, we don't show aidl at all since it is completely present inside java. - If the set of source roots is an improper subset, we only show those folders that have not already been shown. In the above example, for resources, we only show the contents of the 'resources' folder and not the 'src' folder. Fixes https://code.google.com/p/android/issues/detail?id=74243 and https://code.google.com/p/android/issues/detail?id=73928 Change-Id: I4a9c056e96096d6bf29239e5da41fca1746eb70e
Diffstat (limited to 'android/testData')
-rw-r--r--android/testData/projects/navigator/packageview/commonroots/AndroidManifest.xml21
-rw-r--r--android/testData/projects/navigator/packageview/commonroots/build.gradle51
-rw-r--r--android/testData/projects/navigator/packageview/commonroots/res/values-w820dp/dimens.xml6
-rw-r--r--android/testData/projects/navigator/packageview/commonroots/resources/sample_resource.txt0
-rw-r--r--android/testData/projects/navigator/packageview/commonroots/src/com/foo/Foo.java0
5 files changed, 78 insertions, 0 deletions
diff --git a/android/testData/projects/navigator/packageview/commonroots/AndroidManifest.xml b/android/testData/projects/navigator/packageview/commonroots/AndroidManifest.xml
new file mode 100644
index 00000000000..0af21be139a
--- /dev/null
+++ b/android/testData/projects/navigator/packageview/commonroots/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.canon.app" >
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name="com.example.canon.app.MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/android/testData/projects/navigator/packageview/commonroots/build.gradle b/android/testData/projects/navigator/packageview/commonroots/build.gradle
new file mode 100644
index 00000000000..e3930be2dd5
--- /dev/null
+++ b/android/testData/projects/navigator/packageview/commonroots/build.gradle
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+buildscript {
+ repositories {
+ mavenCentral()
+ if (System.getenv("MAVEN_URL") != null) {
+ maven {url System.getenv("MAVEN_URL")}
+ }
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.12.+'
+ }
+}
+
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion '19.1.0'
+
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 19
+ versionCode 10
+ versionName "1.0"
+ }
+
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+ java.srcDirs = ['src']
+ aidl.srcDirs = ['src']
+ resources.srcDirs = ['src', 'resources']
+ res.srcDirs = ['res']
+ }
+ }
+} \ No newline at end of file
diff --git a/android/testData/projects/navigator/packageview/commonroots/res/values-w820dp/dimens.xml b/android/testData/projects/navigator/packageview/commonroots/res/values-w820dp/dimens.xml
new file mode 100644
index 00000000000..63fc8164446
--- /dev/null
+++ b/android/testData/projects/navigator/packageview/commonroots/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+<resources>
+ <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+ <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>
diff --git a/android/testData/projects/navigator/packageview/commonroots/resources/sample_resource.txt b/android/testData/projects/navigator/packageview/commonroots/resources/sample_resource.txt
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/android/testData/projects/navigator/packageview/commonroots/resources/sample_resource.txt
diff --git a/android/testData/projects/navigator/packageview/commonroots/src/com/foo/Foo.java b/android/testData/projects/navigator/packageview/commonroots/src/com/foo/Foo.java
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/android/testData/projects/navigator/packageview/commonroots/src/com/foo/Foo.java