Repository: cashapp/redwood
Pull request #613 (2022-12-09 15:53:03)

Move lint tooling APIs into tooling artifact


Patch:
diff --git a/redwood-cli/build.gradle b/redwood-cli/build.gradle
index 15e69e217..bad6560d7 100644
--- a/redwood-cli/build.gradle
+++ b/redwood-cli/build.gradle
@@ -1,6 +1,5 @@
 apply plugin: 'java-library'
 apply plugin: 'org.jetbrains.kotlin.jvm'
-apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
 apply plugin: 'com.vanniktech.maven.publish'
 apply plugin: 'application'
 
@@ -10,15 +9,13 @@ application {
 }
 
 dependencies {
+  implementation projects.redwoodToolingLint
   implementation projects.redwoodToolingSchema
   implementation libs.kotlinPoet
   implementation libs.lint.core
   implementation libs.clikt
-  implementation libs.kotlinx.serialization.core
-  implementation libs.xmlutil.serialization
 
   testImplementation projects.testSchema.compose
-  testImplementation libs.kotlin.test
   testImplementation libs.junit
   testImplementation libs.truth
   testImplementation libs.jimfs
diff --git a/redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMergeCommand.kt b/redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMergeCommand.kt
index 4b83de43c..640e98c9c 100644
--- a/redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMergeCommand.kt
+++ b/redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMergeCommand.kt
@@ -15,6 +15,7 @@
  */
 package app.cash.redwood.lint
 
+import app.cash.redwood.tooling.lint.ApiMerger
 import com.github.ajalt.clikt.core.CliktCommand
 import com.github.ajalt.clikt.parameters.arguments.argument
 import com.github.ajalt.clikt.parameters.arguments.help
diff --git a/redwood-flex-container/gradle.properties b/redwood-flex-container/gradle.properties
deleted file mode 100644
index 624d80441..000000000
--- a/redwood-flex-container/gradle.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-POM_ARTIFACT_ID=redwood-flex-container
-POM_NAME=Redwood Flex Container
diff --git a/redwood-flex-container/build.gradle b/redwood-flexbox/build.gradle
similarity index 100%
rename from redwood-flex-container/build.gradle
rename to redwood-flexbox/build.gradle
diff --git a/redwood-flexbox/gradle.properties b/redwood-flexbox/gradle.properties
new file mode 100644
index 000000000..3bd734e89
--- /dev/null
+++ b/redwood-flexbox/gradle.properties
@@ -0,0 +1,2 @@
+POM_ARTIFACT_ID=redwood-flexbox
+POM_NAME=Redwood Flex Container
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexContainer.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexContainer.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexContainer.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexContainer.kt
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexItem.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexItem.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexItem.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexItem.kt
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexLine.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexLine.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexLine.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/FlexLine.kt
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/Measurable.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/Measurable.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/Measurable.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/Measurable.kt
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/Orientation.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/Orientation.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/Orientation.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/Orientation.kt
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/properties.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/properties.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/properties.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/properties.kt
diff --git a/redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/utils.kt b/redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/utils.kt
similarity index 100%
rename from redwood-flex-container/src/commonMain/kotlin/app/cash/redwood/flexbox/utils.kt
rename to redwood-flexbox/src/commonMain/kotlin/app/cash/redwood/flexbox/utils.kt
diff --git a/redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerStringCanvasTest.kt b/redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerStringCanvasTest.kt
similarity index 100%
rename from redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerStringCanvasTest.kt
rename to redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerStringCanvasTest.kt
diff --git a/redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerTest.kt b/redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerTest.kt
similarity index 100%
rename from redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerTest.kt
rename to redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/FlexContainerTest.kt
diff --git a/redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/StringCanvas.kt b/redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/StringCanvas.kt
similarity index 100%
rename from redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/StringCanvas.kt
rename to redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/StringCanvas.kt
diff --git a/redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/StringWidget.kt b/redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/StringWidget.kt
similarity index 100%
rename from redwood-flex-container/src/commonTest/kotlin/app/cash/redwood/flexbox/StringWidget.kt
rename to redwood-flexbox/src/commonTest/kotlin/app/cash/redwood/flexbox/StringWidget.kt
diff --git a/redwood-gradle-plugin/build.gradle b/redwood-gradle-plugin/build.gradle
index ec87721f1..62a0d0627 100644
--- a/redwood-gradle-plugin/build.gradle
+++ b/redwood-gradle-plugin/build.gradle
@@ -73,12 +73,13 @@ test {
   dependsOn(':redwood-cli:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-compose:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-gradle-plugin:publishAllPublicationsToLocalMavenRepository')
-  dependsOn(':redwood-flex-container:publishAllPublicationsToLocalMavenRepository')
+  dependsOn(':redwood-flexbox:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-protocol:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-protocol-compose:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-protocol-widget:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-runtime:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-schema:publishAllPublicationsToLocalMavenRepository')
+  dependsOn(':redwood-tooling-lint:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-tooling-schema:publishAllPublicationsToLocalMavenRepository')
   dependsOn(':redwood-widget:publishAllPublicationsToLocalMavenRepository')
 
diff --git a/redwood-layout-composeui/build.gradle b/redwood-layout-composeui/build.gradle
index 958a0e40c..9a387d8c1 100644
--- a/redwood-layout-composeui/build.gradle
+++ b/redwood-layout-composeui/build.gradle
@@ -9,7 +9,7 @@ apply plugin: 'org.jetbrains.dokka' // Must be applied here for publish plugin.
 
 dependencies {
   api projects.redwoodLayoutSchema.widget
-  implementation projects.redwoodFlexContainer
+  implementation projects.redwoodFlexbox
   implementation projects.redwoodWidgetCompose
   implementation libs.androidx.core
   implementation libs.androidx.compose.foundation
diff --git a/redwood-layout-uiview/build.gradle b/redwood-layout-uiview/build.gradle
index df92d1382..b6a95eb27 100644
--- a/redwood-layout-uiview/build.gradle
+++ b/redwood-layout-uiview/build.gradle
@@ -14,7 +14,7 @@ kotlin {
       kotlin.srcDir(FlexboxHelpers.get(tasks, 'app.cash.redwood.layout.uiview'))
       dependencies {
         api projects.redwoodLayoutSchema.widget
-        implementation projects.redwoodFlexContainer
+        implementation projects.redwoodFlexbox
         implementation projects.redwoodWidgetCompose
       }
     }
diff --git a/redwood-layout-view/build.gradle b/redwood-layout-view/build.gradle
index 77650d18a..c548da5cd 100644
--- a/redwood-layout-view/build.gradle
+++ b/redwood-layout-view/build.gradle
@@ -9,7 +9,7 @@ apply plugin: 'org.jetbrains.dokka' // Must be applied here for publish plugin.
 
 dependencies {
   api projects.redwoodLayoutSchema.widget
-  implementation projects.redwoodFlexContainer
+  implementation projects.redwoodFlexbox
   implementation libs.androidx.core
   testImplementation projects.redwoodLayoutSharedTest
 }
diff --git a/redwood-tooling-lint/build.gradle b/redwood-tooling-lint/build.gradle
new file mode 100644
index 000000000..217ce1269
--- /dev/null
+++ b/redwood-tooling-lint/build.gradle
@@ -0,0 +1,12 @@
+apply plugin: 'org.jetbrains.kotlin.jvm'
+apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
+apply plugin: 'com.vanniktech.maven.publish'
+
+dependencies {
+  implementation libs.kotlinx.serialization.core
+  implementation libs.xmlutil.serialization
+
+  testImplementation libs.kotlin.test
+  testImplementation libs.junit
+  testImplementation libs.truth
+}
diff --git a/redwood-tooling-lint/gradle.properties b/redwood-tooling-lint/gradle.properties
new file mode 100644
index 000000000..f782d59ce
--- /dev/null
+++ b/redwood-tooling-lint/gradle.properties
@@ -0,0 +1,2 @@
+POM_ARTIFACT_ID=redwood-tooling-lint
+POM_NAME=Redwood tooling: lint
diff --git a/redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMerger.kt b/redwood-tooling-lint/src/main/kotlin/app/cash/redwood/tooling/lint/ApiMerger.kt
similarity index 98%
rename from redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMerger.kt
rename to redwood-tooling-lint/src/main/kotlin/app/cash/redwood/tooling/lint/ApiMerger.kt
index a0bf0a2d7..0e6222c28 100644
--- a/redwood-cli/src/main/kotlin/app/cash/redwood/lint/ApiMerger.kt
+++ b/redwood-tooling-lint/src/main/kotlin/app/cash/redwood/tooling/lint/ApiMerger.kt
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package app.cash.redwood.lint
+package app.cash.redwood.tooling.lint
 
 /**
  * Merges one or more API definitions into a single, merged API definition.
diff --git a/redwood-cli/src/main/kotlin/app/cash/redwood/lint/apiModel.kt b/redwood-tooling-lint/src/main/kotlin/app/cash/redwood/tooling/lint/apiModel.kt
similarity index 98%
rename from redwood-cli/src/main/kotlin/app/cash/redwood/lint/apiModel.kt
rename to redwood-tooling-lint/src/main/kotlin/app/cash/redwood/tooling/lint/apiModel.kt
index be839e9ad..3bd90b0fc 100644
--- a/redwood-cli/src/main/kotlin/app/cash/redwood/lint/apiModel.kt
+++ b/redwood-tooling-lint/src/main/kotlin/app/cash/redwood/tooling/lint/apiModel.kt
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package app.cash.redwood.lint
+package app.cash.redwood.tooling.lint
 
 import kotlinx.serialization.SerialName
 import kotlinx.serialization.Serializable
diff --git a/settings.gradle b/settings.gradle
index b76874133..907b7d2f6 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -2,7 +2,7 @@ rootProject.name = 'redwood'
 
 include ':redwood-cli'
 include ':redwood-compose'
-include ':redwood-flex-container'
+include ':redwood-flexbox'
 include ':redwood-gradle-plugin'
 include ':redwood-layout-api'
 include ':redwood-layout-composeui'
@@ -17,6 +17,7 @@ include ':redwood-protocol-compose'
 include ':redwood-protocol-widget'
 include ':redwood-runtime'
 include ':redwood-schema'
+include ':redwood-tooling-lint'
 include ':redwood-tooling-schema'
 include ':redwood-treehouse'
 include ':redwood-treehouse-composeui'


Test patch:
diff --git a/redwood-layout-shared-test/build.gradle b/redwood-layout-shared-test/build.gradle
index cb9b854d9..74cdaba40 100644
--- a/redwood-layout-shared-test/build.gradle
+++ b/redwood-layout-shared-test/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
 apply plugin: 'org.jetbrains.kotlin.android'
 
 dependencies {
-  api projects.redwoodFlexContainer
+  api projects.redwoodFlexbox
   api projects.redwoodLayoutApi
   api projects.redwoodLayoutSchema.layoutModifiers
   api projects.redwoodRuntime
diff --git a/redwood-cli/src/test/kotlin/app/cash/redwood/lint/ApiMergerTest.kt b/redwood-tooling-lint/src/test/kotlin/app/cash/redwood/tooling/lint/ApiMergerTest.kt
similarity index 99%
rename from redwood-cli/src/test/kotlin/app/cash/redwood/lint/ApiMergerTest.kt
rename to redwood-tooling-lint/src/test/kotlin/app/cash/redwood/tooling/lint/ApiMergerTest.kt
index db1692e8e..2de809438 100644
--- a/redwood-cli/src/test/kotlin/app/cash/redwood/lint/ApiMergerTest.kt
+++ b/redwood-tooling-lint/src/test/kotlin/app/cash/redwood/tooling/lint/ApiMergerTest.kt
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package app.cash.redwood.lint
+package app.cash.redwood.tooling.lint
 
 import com.google.common.truth.Truth.assertThat
 import kotlin.test.assertFailsWith