[go: nahoru, domu]

Moves ui-material, ui-material-icons-core, and ui-material-icons-extended to androidx.compose.material

This CL does not touch package names, or directory structure - only the maven group.

Bug: b/160233169
Test: ./gradlew bOS
Change-Id: I2e5cbf4e0cae3f0453db7d89507c8ee392c33935
diff --git a/ui/README.md b/ui/README.md
index 6d57d20..72534f4 100644
--- a/ui/README.md
+++ b/ui/README.md
@@ -28,13 +28,7 @@
 
 Run the `demos` app to see examples of individual components.
 
-A sample implementation of the [Material Rally app](https://material.io/design/material-studies/rally.html) is under `material/integration-tests/material-studies`.
-
-To build the Material Rally app via the command line run:
-
-    cd path/to/checkout/frameworks/support/ui/
-    ./gradlew :ui-material:integration-tests:ui-material-studies:assembleDebug
-
+A sample implementation of the [Material Rally app](https://material.io/design/material-studies/rally.html) is under `material/integration-tests/material-studies`. This can be viewed from inside the `demos` app, under the 'Material Studies' section.
 
 ## Structure
 Library code for Jetpack Compose lives under the `frameworks/support/ui` directory. Additionally, sample code can be found within each module in the `integration-tests` subdirectories and the compiler and runtime code can be found in `frameworks/support/compose`.
diff --git a/ui/integration-tests/benchmark/build.gradle b/ui/integration-tests/benchmark/build.gradle
index 40db4f5..2689f07 100644
--- a/ui/integration-tests/benchmark/build.gradle
+++ b/ui/integration-tests/benchmark/build.gradle
@@ -44,7 +44,7 @@
 
     androidTestImplementation project(":ui:ui-core")
     androidTestImplementation project(":ui:ui-layout")
-    androidTestImplementation project(":ui:ui-material")
+    androidTestImplementation project(":compose:material:material")
     androidTestImplementation project(":ui:ui-test")
     androidTestImplementation project(":compose:compose-runtime")
     androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
diff --git a/ui/integration-tests/build.gradle b/ui/integration-tests/build.gradle
index 4ec4ee6..fd59f7d 100644
--- a/ui/integration-tests/build.gradle
+++ b/ui/integration-tests/build.gradle
@@ -42,7 +42,7 @@
     implementation project(":ui:ui-core")
     implementation project(":ui:ui-foundation")
     implementation project(":ui:ui-layout")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
     implementation project(":ui:ui-test")
 }
 
diff --git a/ui/integration-tests/demos/build.gradle b/ui/integration-tests/demos/build.gradle
index 57598cf..d5a4c82 100644
--- a/ui/integration-tests/demos/build.gradle
+++ b/ui/integration-tests/demos/build.gradle
@@ -17,8 +17,8 @@
     implementation project(":ui:ui-foundation:integration-tests:ui-foundation-demos")
     implementation project(":ui:ui-core:integration-tests:ui-core-demos")
     implementation project(":ui:ui-layout:integration-tests:ui-layout-demos")
-    implementation project(":ui:ui-material:integration-tests:ui-material-demos")
-    implementation project(":ui:ui-material:integration-tests:ui-material-studies")
+    implementation project(":compose:material:material:integration-tests:material-demos")
+    implementation project(":compose:material:material:integration-tests:material-studies")
     implementation project(":ui:ui-text:integration-tests:ui-text-compose-demos")
 
     implementation(KOTLIN_REFLECT)
@@ -30,7 +30,7 @@
     implementation project(":ui:ui-layout")
     implementation project(":ui:ui-text")
     implementation project(":ui:ui-foundation")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
     implementation project(":ui:integration-tests:demos:common")
 
     implementation "androidx.preference:preference-ktx:1.1.0"
@@ -43,8 +43,8 @@
     androidTestImplementation project(":ui:ui-foundation:integration-tests:ui-foundation-demos")
     androidTestImplementation project(":ui:ui-core:integration-tests:ui-core-demos")
     androidTestImplementation project(":ui:ui-layout:integration-tests:ui-layout-demos")
-    androidTestImplementation project(":ui:ui-material:integration-tests:ui-material-demos")
-    androidTestImplementation project(":ui:ui-material:integration-tests:ui-material-studies")
+    androidTestImplementation project(":compose:material:material:integration-tests:material-demos")
+    androidTestImplementation project(":compose:material:material:integration-tests:material-studies")
     androidTestImplementation project(":ui:ui-text:integration-tests:ui-text-compose-demos")
 
     androidTestImplementation(ANDROIDX_TEST_RULES)
diff --git a/ui/settings.gradle b/ui/settings.gradle
index 5b451f7..b3c8609 100644
--- a/ui/settings.gradle
+++ b/ui/settings.gradle
@@ -87,14 +87,14 @@
 includeProject(":ui:ui-layout", "ui-layout")
 includeProject(":ui:ui-layout:integration-tests:ui-layout-demos", "ui-layout/integration-tests/layout-demos")
 includeProject(":ui:ui-layout:samples", "ui-layout/samples")
-includeProject(":ui:ui-material", "ui-material")
-includeProject(":ui:ui-material:integration-tests:ui-material-demos", "ui-material/integration-tests/material-demos")
-includeProject(":ui:ui-material:integration-tests:ui-material-studies", "ui-material/integration-tests/material-studies")
-includeProject(":ui:ui-material:samples", "ui-material/samples")
-includeProject(":ui:ui-material-icons-core", "ui-material/icons/core")
-includeProject(":ui:ui-material-icons-core:samples", "ui-material/icons/core/samples")
-includeProject(":ui:ui-material-icons-extended", "ui-material/icons/extended")
-includeProject(":ui:ui-material:icons:generator", "ui-material/icons/generator")
+includeProject(":compose:material:material", "ui-material")
+includeProject(":compose:material:material:integration-tests:material-demos", "ui-material/integration-tests/material-demos")
+includeProject(":compose:material:material:integration-tests:material-studies", "ui-material/integration-tests/material-studies")
+includeProject(":compose:material:material:samples", "ui-material/samples")
+includeProject(":compose:material:material-icons-core", "ui-material/icons/core")
+includeProject(":compose:material:material-icons-core:samples", "ui-material/icons/core/samples")
+includeProject(":compose:material:material-icons-extended", "ui-material/icons/extended")
+includeProject(":compose:material:material:icons:generator", "ui-material/icons/generator")
 includeProject(":ui:ui-test", "ui-test")
 includeProject(":ui:ui-test-font", "ui-test-font")
 includeProject(":ui:ui-text", "ui-text")
diff --git a/ui/ui-android-view/integration-tests/android-view-demos/build.gradle b/ui/ui-android-view/integration-tests/android-view-demos/build.gradle
index e87fcb9..15b72c7 100644
--- a/ui/ui-android-view/integration-tests/android-view-demos/build.gradle
+++ b/ui/ui-android-view/integration-tests/android-view-demos/build.gradle
@@ -35,7 +35,7 @@
     implementation project(":ui:ui-android-view")
     implementation project(":ui:ui-core")
     implementation project(":ui:ui-layout")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
 }
 
 android {
diff --git a/ui/ui-core/integration-tests/ui-core-demos/build.gradle b/ui/ui-core/integration-tests/ui-core-demos/build.gradle
index b6b625c..a9b2dfc 100644
--- a/ui/ui-core/integration-tests/ui-core-demos/build.gradle
+++ b/ui/ui-core/integration-tests/ui-core-demos/build.gradle
@@ -21,7 +21,7 @@
     implementation project(":ui:ui-text-core")
     implementation project(":ui:ui-animation")
     implementation project(":ui:ui-foundation")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
     implementation project(":ui:ui-livedata")
 }
 
diff --git a/ui/ui-core/samples/build.gradle b/ui/ui-core/samples/build.gradle
index 698232a..ac6e965 100644
--- a/ui/ui-core/samples/build.gradle
+++ b/ui/ui-core/samples/build.gradle
@@ -35,7 +35,7 @@
     implementation project(":compose:compose-runtime")
     implementation project(":ui:ui-core")
     implementation project(":ui:ui-layout")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
 }
 
 android {
diff --git a/ui/ui-desktop/build.gradle b/ui/ui-desktop/build.gradle
index 8e14a18..6d6d410 100644
--- a/ui/ui-desktop/build.gradle
+++ b/ui/ui-desktop/build.gradle
@@ -131,28 +131,28 @@
 }
 
 def uiComponents = [
-        "ui-android-view",
-        "ui-animation",
-        "ui-animation-core",
-        "ui-core",
-        "ui-foundation",
-        "ui-geometry",
-        "ui-graphics",
-        "ui-layout",
-        "ui-livedata",
-        "ui-material",
-        "ui-saved-instance-state",
-        "ui-text",
-        "ui-text-android",
-        "ui-text-core",
-        "ui-unit",
-        "ui-util"
+        ":ui:ui-android-view",
+        ":ui:ui-animation",
+        ":ui:ui-animation-core",
+        ":ui:ui-core",
+        ":ui:ui-foundation",
+        ":ui:ui-geometry",
+        ":ui:ui-graphics",
+        ":ui:ui-layout",
+        ":ui:ui-livedata",
+        ":ui:ui-saved-instance-state",
+        ":ui:ui-text",
+        ":ui:ui-text-android",
+        ":ui:ui-text-core",
+        ":ui:ui-unit",
+        ":ui:ui-util",
+        ":compose:material:material"
 ]
 
-def androidxComponents = [
-        "core:core",
-        "lifecycle:lifecycle-runtime"
-]
+// Returns the artifact name (project name) from a project path
+static String uiComponentArtifactName(String component) {
+    return component.tokenize(':').last()
+}
 
 void makeLinkOrCopy(String from, String to) {
     def fromPath = Paths.get(from)
@@ -237,10 +237,11 @@
     inputs.files(project.provider {
         def result = []
         uiComponents.each { component ->
-            def depProject = project(":ui:" + component)
+            def depProject = project(component)
             def task = depProject.tasks.named("assemble").get()
             def srcJar = findInDeps(task, { absolutePath ->
-                absolutePath.endsWith("classes.jar") && absolutePath.contains(component)
+                def componentPath = component.replaceAll(":", "/")
+                absolutePath.endsWith("classes.jar") && absolutePath.contains(componentPath)
             })
             result.add(file(srcJar))
         }
@@ -268,12 +269,7 @@
     outputs.files(project.provider {
         def result = [fileTree(dir: composeClassDir, include: [])]
         uiComponents.each { component ->
-            def depProject = project(":ui:" + component)
-            def task = depProject.tasks.named("assemble").get()
-            def srcJar = findInDeps(task, { absolutePath ->
-                absolutePath.endsWith("classes.jar") && absolutePath.contains(component)
-            })
-            result.add(file(composeClassDir + component + ".jar"))
+            result.add(file(composeClassDir + uiComponentArtifactName(component) + ".jar"))
         }
         configurations.ui_components.getIncoming().artifactView(
                 { config ->
@@ -291,15 +287,16 @@
         // Find all JAR files matching components.
         file(composeClassDir).mkdir()
         uiComponents.each { component ->
-            def depProject = project(":ui:" + component)
+            def depProject = project(component)
             def task = depProject.tasks.named("assemble").get()
             def srcJar = findInDeps(task, { absolutePath ->
-                absolutePath.endsWith("classes.jar") && absolutePath.contains(component)
+                def componentPath = component.replaceAll(":", "/")
+                absolutePath.endsWith("classes.jar") && absolutePath.contains(componentPath)
             })
             if (srcJar == null) {
                 throw new Error("cannot find classes.jar in "+ task)
             } else {
-                def destJar = composeClassDir + component + ".jar"
+                def destJar = composeClassDir + uiComponentArtifactName(component) + ".jar"
                 makeLinkOrCopy(srcJar, destJar)
             }
         }
@@ -321,7 +318,7 @@
 
 extractJars.configure {
     uiComponents.each { component ->
-        extractJars.dependsOn(":ui:" + component + ":assemble")
+        extractJars.dependsOn(component + ":assemble")
     }
 }
 
diff --git a/ui/ui-material/build.gradle b/ui/ui-material/build.gradle
index 15e53ec..1175ff7 100644
--- a/ui/ui-material/build.gradle
+++ b/ui/ui-material/build.gradle
@@ -39,7 +39,7 @@
     implementation project(":ui:ui-util")
     api project(":ui:ui-core")
     api project(":ui:ui-foundation")
-    api project(":ui:ui-material-icons-core")
+    api project(":compose:material:material-icons-core")
     api project(":ui:ui-text-core")
     api project(":ui:ui-text")
     api project(":ui:ui-animation-core")
@@ -52,7 +52,7 @@
     testImplementation(JUNIT)
     testImplementation(TRUTH)
 
-    androidTestImplementation project(":ui:ui-material:samples")
+    androidTestImplementation project(":compose:material:material:samples")
     androidTestImplementation project(":ui:ui-test")
     androidTestImplementation project(":test-screenshot")
 
@@ -71,7 +71,7 @@
     name = "Androidx Material"
     publish = Publish.SNAPSHOT_AND_RELEASE
     mavenVersion = LibraryVersions.UI
-    mavenGroup = LibraryGroups.UI
+    mavenGroup = LibraryGroups.Compose.MATERIAL
     inceptionYear = "2018"
     description = "AndroidX Material"
 }
diff --git a/ui/ui-material/icons/README.md b/ui/ui-material/icons/README.md
index 69b347a..98205c1 100644
--- a/ui/ui-material/icons/README.md
+++ b/ui/ui-material/icons/README.md
@@ -4,8 +4,8 @@
 Material iconography is split across three modules:
 
  1. The `generator` module, in `generator/` - this module processes and generates Kotlin source files as part of the build step of the other modules. This module is not shipped as an artifact, and caches its outputs based on the input icons (found in `generator/raw-icons`).
- 2. `ui-material-icons-core` , in `core/` - this module contains _core_ icons, the set of most-commonly-used icons used by applications, including the icons that are required by Material components themselves, such as the menu icon. This module is fairly small and is depended on by `ui-material`.
- 3. `ui-material-icons-extended`, in `extended/` - this module contains every icon that is not in `ui-material-icons-core`, and has a transitive `api` dependency on `ui-material-icons-core`, so depending on this module will provide every single Material icon (over 5000 at the time of writing). Due to the excessive size of this module, this module should ***NOT*** be included as a direct dependency of any other library, and should only be used if Proguard / R8 is enabled.
+ 2. `material-icons-core` , in `core/` - this module contains _core_ icons, the set of most-commonly-used icons used by applications, including the icons that are required by Material components themselves, such as the menu icon. This module is fairly small and is depended on by `material`.
+ 3. `material-icons-extended`, in `extended/` - this module contains every icon that is not in `material-icons-core`, and has a transitive `api` dependency on `material-icons-core`, so depending on this module will provide every single Material icon (over 5000 at the time of writing). Due to the excessive size of this module, this module should ***NOT*** be included as a direct dependency of any other library, and should only be used if Proguard / R8 is enabled.
 
 ## Icon Generation
 
diff --git a/ui/ui-material/icons/core/build.gradle b/ui/ui-material/icons/core/build.gradle
index 5c8f1d1..9259547 100644
--- a/ui/ui-material/icons/core/build.gradle
+++ b/ui/ui-material/icons/core/build.gradle
@@ -40,7 +40,7 @@
     name = "AndroidX Core Material Icons"
     publish = Publish.SNAPSHOT_AND_RELEASE
     mavenVersion = LibraryVersions.UI
-    mavenGroup = LibraryGroups.UI
+    mavenGroup = LibraryGroups.Compose.MATERIAL
     inceptionYear = "2020"
     description = "AndroidX Core Material Icons"
 }
diff --git a/ui/ui-material/icons/core/samples/build.gradle b/ui/ui-material/icons/core/samples/build.gradle
index 7b32914..35b7723 100644
--- a/ui/ui-material/icons/core/samples/build.gradle
+++ b/ui/ui-material/icons/core/samples/build.gradle
@@ -33,8 +33,8 @@
     implementation project(":annotation:annotation-sampled")
 
     implementation project(":compose:compose-runtime")
-    implementation project(":ui:ui-material")
-    implementation project(":ui:ui-material-icons-core")
+    implementation project(":compose:material:material")
+    implementation project(":compose:material:material-icons-core")
 }
 
 android {
diff --git a/ui/ui-material/icons/extended/build.gradle b/ui/ui-material/icons/extended/build.gradle
index 174ce2a..fc265fc 100644
--- a/ui/ui-material/icons/extended/build.gradle
+++ b/ui/ui-material/icons/extended/build.gradle
@@ -33,7 +33,7 @@
     kotlinPlugin project(path: ":compose:compose-compiler")
     implementation(KOTLIN_STDLIB)
 
-    api project(":ui:ui-material-icons-core")
+    api project(":compose:material:material-icons-core")
     implementation project(":compose:compose-runtime")
 
     androidTestImplementation project(":ui:ui-foundation")
@@ -59,7 +59,7 @@
     name = "AndroidX Extended Material Icons"
     publish = Publish.SNAPSHOT_AND_RELEASE
     mavenVersion = LibraryVersions.UI
-    mavenGroup = LibraryGroups.UI
+    mavenGroup = LibraryGroups.Compose.MATERIAL
     // This module has a large number (5000+) of generated source files and so doc generation /
     // API tracking will simply take too long
     toolingProject = true
diff --git a/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/CoreIcons.kt b/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/CoreIcons.kt
index 1c61a3d..3c15eb5 100644
--- a/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/CoreIcons.kt
+++ b/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/CoreIcons.kt
@@ -18,7 +18,7 @@
 
 /**
  * List of 'core' icons that will be added to the 'core' icons module, and depended on by
- * ui-material. These icons are the set of most commonly used icons, including icons used by
+ * material. These icons are the set of most commonly used icons, including icons used by
  * Material components directly (such as the menu icon in an AppBar). All icons not specified
  * here will be generated to the 'extended' icons module.
  */
diff --git a/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/tasks/IconGenerationTask.kt b/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/tasks/IconGenerationTask.kt
index 79f05ae..6fe7284 100644
--- a/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/tasks/IconGenerationTask.kt
+++ b/ui/ui-material/icons/generator/src/main/kotlin/androidx/ui/material/icons/generator/tasks/IconGenerationTask.kt
@@ -117,7 +117,7 @@
 }
 
 // Path to the generator project
-private const val GeneratorProject = ":ui:ui-material:icons:generator"
+private const val GeneratorProject = ":compose:material:material:icons:generator"
 
 /**
  * Registers a new [T] in [this], and sets [IconGenerationTask.buildDirectory] depending on
diff --git a/ui/ui-material/integration-tests/material-demos/build.gradle b/ui/ui-material/integration-tests/material-demos/build.gradle
index 472abad..0488ab9 100644
--- a/ui/ui-material/integration-tests/material-demos/build.gradle
+++ b/ui/ui-material/integration-tests/material-demos/build.gradle
@@ -21,10 +21,10 @@
     implementation project(":ui:ui-core")
     implementation project(":ui:ui-foundation")
     implementation project(":ui:ui-layout")
-    implementation project(":ui:ui-material:samples")
+    implementation project(":compose:material:material:samples")
     implementation project(":ui:ui-text-core")
     implementation project(":ui:ui-android-view")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
 }
 
 android {
diff --git a/ui/ui-material/integration-tests/material-studies/build.gradle b/ui/ui-material/integration-tests/material-studies/build.gradle
index 0d8f3e5..2c9951e 100644
--- a/ui/ui-material/integration-tests/material-studies/build.gradle
+++ b/ui/ui-material/integration-tests/material-studies/build.gradle
@@ -41,7 +41,7 @@
     implementation project(":ui:ui-layout")
     implementation project(":ui:ui-animation")
     implementation project(":ui:ui-text-core")
-    implementation project(':ui:ui-material')
+    implementation project(':compose:material:material')
 }
 
 android {
diff --git a/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/Icons.kt b/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/Icons.kt
index b9c2597..16a8967 100644
--- a/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/Icons.kt
+++ b/ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/Icons.kt
@@ -53,11 +53,11 @@
 }
 
 /**
- * Icons below are copied from [Icons.Filled] in ui-material-icons-extended to avoid recompiling the
+ * Icons below are copied from [Icons.Filled] in material-icons-extended to avoid recompiling the
  * module in demos. In the future when we release a stable artifact we could directly depend on
  * that, instead of a project dependency which causes recompilation.
  *
- * If the generated icons change, just build ui-material-icons-extended and copy the generated
+ * If the generated icons change, just build material-icons-extended and copy the generated
  * file, which should appear in Studio sources by searching for the name of that icon.
  */
 
diff --git a/ui/ui-material/samples/build.gradle b/ui/ui-material/samples/build.gradle
index 6b225e2..3688598 100644
--- a/ui/ui-material/samples/build.gradle
+++ b/ui/ui-material/samples/build.gradle
@@ -37,7 +37,7 @@
     implementation project(":ui:ui-core")
     implementation project(":ui:ui-foundation")
     implementation project(":ui:ui-layout")
-    implementation project(":ui:ui-material")
+    implementation project(":compose:material:material")
     implementation project(":ui:ui-text-core")
 }
 
diff --git a/ui/ui-test/build.gradle b/ui/ui-test/build.gradle
index f809e12..7bb5698 100644
--- a/ui/ui-test/build.gradle
+++ b/ui/ui-test/build.gradle
@@ -54,7 +54,7 @@
 
     androidTestImplementation(TRUTH)
     androidTestImplementation project(":ui:ui-core")
-    androidTestImplementation project(':ui:ui-material')
+    androidTestImplementation project(':compose:material:material')
 }
 
 android {
diff --git a/ui/ui-tooling/build.gradle b/ui/ui-tooling/build.gradle
index 3de1f67..f51576e 100644
--- a/ui/ui-tooling/build.gradle
+++ b/ui/ui-tooling/build.gradle
@@ -37,7 +37,7 @@
 
     api(project(":compose:compose-runtime"))
     api(project(":ui:ui-core"))
-    implementation(project(":ui:ui-material"))
+    implementation(project(":compose:material:material"))
     // kotlin-reflect is provided by Studio at runtime
     compileOnly(KOTLIN_REFLECT)