forked from cashapp/paparazzi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "update layoutlib to 31.4.0-alpha03 and 14.0.1 published by Go…
…ogle" This reverts commit 28ee920.
- Loading branch information
1 parent
53845f9
commit 1f31cf9
Showing
15 changed files
with
256 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Paparazzi Libraries | ||
------------------- | ||
|
||
This project publishes artifacts from [Android Studio's][android_studio] UI renderer to Maven | ||
Central so that we can consume them in Paparazzi. | ||
|
||
Note that layoutlib's version tracks [Android Studio Releases][studio_releases] and not Paparazzi. | ||
|
||
1. Find the corresponding [Android Studio version][studio_versions] you wish to update LayoutLib to. | ||
``` | ||
Flamingo => 2022.2.1 | ||
``` | ||
2. Find and click the [tag][prebuilt_refs] for the prebuilt corresponding to that version. | ||
3. Copy the commit short sha from the resulting page | ||
``` | ||
# Example: https://android.googlesource.com/platform/prebuilts/studio/layoutlib/+/refs/tags/studio-2022.2.1 | ||
512837137ea60b9b86836cab7169fec5c635f422 => 5128371 | ||
``` | ||
4. Update commit link, `layoutlib` and `layoutlibPrebuiltSha` in `libs.versions.toml` as expected. | ||
``` | ||
https://android.googlesource.com/platform/prebuilts/studio/layoutlib/+/5128371 | ||
... | ||
layoutlib = "2022.2.1-5128371" | ||
layoutlibPrebuiltSha = "5128371" | ||
``` | ||
5. Build and upload: | ||
``` | ||
./gradlew publishMavenNativeLibraryPublicationToMavenCentralRepository | ||
``` | ||
This may take a few minutes. It clones a large repo (2.4 GiB) and then uploads a large artifact | ||
(30 MiB) to Maven Central. | ||
6. Visit [Sonatype Nexus][nexus] to promote the artifact. Or drop it if there is a problem! | ||
7. Once deploy is live, continue with changeset from step 4 to update Paparazzi to consume this | ||
latest version. Here's an [example PR][dolphin_bump]. | ||
Prerequisites | ||
------------- | ||
In `~/.gradle/gradle.properties`, set the following: | ||
* `mavenCentralUsername` - Sonatype username for releasing to `app.cash`. | ||
* `mavenCentralPassword` - Sonatype password for releasing to `app.cash`. | ||
[android_studio]: https://developer.android.com/studio | ||
[studio_releases]: https://developer.android.com/studio/releases | ||
[studio_versions]: https://developer.android.com/studio/releases#android_gradle_plugin_and_android_studio_compatibility | ||
[nexus]: https://oss.sonatype.org/ | ||
[prebuilt_refs]: https://android.googlesource.com/platform/prebuilts/studio/layoutlib/+refs | ||
[dolphin_bump]: https://github.com/cashapp/paparazzi/pull/639 |
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 @@ | ||
ext.repoDir = rootProject.layout.buildDirectory.dir("prebuilts/studio/layoutlib").get().asFile |
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,61 @@ | ||
import org.ajoberstar.grgit.Grgit | ||
|
||
apply plugin: 'com.vanniktech.maven.publish' | ||
|
||
/** | ||
* Clone AOSP's prebuilts repo to get a prebuilt layoutlib jar. This big repo that takes a long time to clone! | ||
* | ||
* https://android.googlesource.com/platform/prebuilts/studio/layoutlib/+/refs/tags/studio-4.1.0/PREBUILT | ||
*/ | ||
tasks.register('cloneLayoutlib') { | ||
it.outputs.dir(repoDir) | ||
it.inputs.property('sha', libs.versions.layoutlibPrebuiltSha) | ||
|
||
doFirst { | ||
// Gradle aggressively creates outputs directories, which interferes with the git clone check | ||
if (repoDir.exists() && !repoDir.list()) { | ||
repoDir.delete() | ||
} | ||
Grgit grgit | ||
if (!repoDir.exists()) { | ||
logger.warn('Cloning prebuilt layoutlib: this may take a few minutes...') | ||
grgit = Grgit.clone { | ||
dir = repoDir | ||
uri = "https://android.googlesource.com/platform/prebuilts/studio/layoutlib" | ||
} | ||
logger.warn('Cloned prebuilt layoutlib.') | ||
} else { | ||
logger.warn('Using existing prebuilt layoutlib clone.') | ||
grgit = Grgit.open { | ||
dir = repoDir | ||
} | ||
} | ||
grgit.withCloseable { repo -> | ||
repo.fetch() | ||
logger.warn("Checking out SHA ${libs.versions.layoutlibPrebuiltSha.get()}") | ||
repo.checkout { | ||
branch = libs.versions.layoutlibPrebuiltSha.get() | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Publish layoutlib.jar to Maven Central with Paparazzi coordinates. | ||
*/ | ||
mavenPublishing { | ||
coordinates(property("GROUP"), property("POM_ARTIFACT_ID"), libs.versions.layoutlib.get()) | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNativeLibrary(MavenPublication) { | ||
artifact(tasks. | ||
named("cloneLayoutlib"). | ||
map { new File(it.outputs.files.getSingleFile(), 'data/layoutlib.jar') } | ||
) | ||
artifact emptySourcesJar | ||
artifact emptyJavadocJar | ||
} | ||
} | ||
} |
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,4 @@ | ||
POM_ARTIFACT_ID=layoutlib-native-jdk11 | ||
POM_NAME=Native LayoutLib for JDK 11 | ||
POM_DESCRIPTION=Android Studio's native layoutlib binary compatible with JDK 11+, packaged for Paparazzi | ||
POM_PACKAGING=jar |
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,26 @@ | ||
apply plugin: 'com.vanniktech.maven.publish' | ||
|
||
tasks.register('linuxJar', Jar) { | ||
from(repoDir) { | ||
include 'data/linux/**' | ||
include 'data/fonts/**' | ||
include 'data/icu/**' | ||
include 'data/keyboards/**' | ||
exclude '**/BUILD' | ||
} | ||
dependsOn(':libs:layoutlib:cloneLayoutlib') | ||
} | ||
|
||
mavenPublishing { | ||
coordinates(property("GROUP"), property("POM_ARTIFACT_ID"), libs.versions.layoutlib.get()) | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNativeLibrary(MavenPublication) { | ||
artifact linuxJar | ||
artifact emptySourcesJar | ||
artifact emptyJavadocJar | ||
} | ||
} | ||
} |
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,4 @@ | ||
POM_ARTIFACT_ID=layoutlib-native-linux | ||
POM_NAME=Native Android Runtime for Linux | ||
POM_DESCRIPTION=Android runtime for Linux, fonts, and ICU data, packaged for Paparazzi | ||
POM_PACKAGING=jar |
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,26 @@ | ||
apply plugin: 'com.vanniktech.maven.publish' | ||
|
||
tasks.register('macArmJar', Jar) { | ||
from(repoDir) { | ||
include 'data/mac-arm/**' | ||
include 'data/fonts/**' | ||
include 'data/icu/**' | ||
include 'data/keyboards/**' | ||
exclude '**/BUILD' | ||
} | ||
dependsOn(':libs:layoutlib:cloneLayoutlib') | ||
} | ||
|
||
mavenPublishing { | ||
coordinates(property("GROUP"), property("POM_ARTIFACT_ID"), libs.versions.layoutlib.get()) | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNativeLibrary(MavenPublication) { | ||
artifact macArmJar | ||
artifact emptySourcesJar | ||
artifact emptyJavadocJar | ||
} | ||
} | ||
} |
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,4 @@ | ||
POM_ARTIFACT_ID=layoutlib-native-macarm | ||
POM_NAME=Native Android Runtime for M1 Macs | ||
POM_DESCRIPTION=Android runtime for M1 Macs, fonts, and ICU data, packaged for Paparazzi | ||
POM_PACKAGING=jar |
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,26 @@ | ||
apply plugin: 'com.vanniktech.maven.publish' | ||
|
||
tasks.register('macJar', Jar) { | ||
from(repoDir) { | ||
include 'data/mac/**' | ||
include 'data/fonts/**' | ||
include 'data/icu/**' | ||
include 'data/keyboards/**' | ||
exclude '**/BUILD' | ||
} | ||
dependsOn(':libs:layoutlib:cloneLayoutlib') | ||
} | ||
|
||
mavenPublishing { | ||
coordinates(property("GROUP"), property("POM_ARTIFACT_ID"), libs.versions.layoutlib.get()) | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNativeLibrary(MavenPublication) { | ||
artifact macJar | ||
artifact emptySourcesJar | ||
artifact emptyJavadocJar | ||
} | ||
} | ||
} |
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,4 @@ | ||
POM_ARTIFACT_ID=layoutlib-native-macosx | ||
POM_NAME=Native Android Runtime for Mac OSX | ||
POM_DESCRIPTION=Android runtime for Mac OSX, fonts, and ICU data, packaged for Paparazzi | ||
POM_PACKAGING=jar |
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,26 @@ | ||
apply plugin: 'com.vanniktech.maven.publish' | ||
|
||
tasks.register('winJar', Jar) { | ||
from(repoDir) { | ||
include 'data/win/**' | ||
include 'data/fonts/**' | ||
include 'data/icu/**' | ||
include 'data/keyboards/**' | ||
exclude '**/BUILD' | ||
} | ||
dependsOn(':libs:layoutlib:cloneLayoutlib') | ||
} | ||
|
||
mavenPublishing { | ||
coordinates(property("GROUP"), property("POM_ARTIFACT_ID"), libs.versions.layoutlib.get()) | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNativeLibrary(MavenPublication) { | ||
artifact winJar | ||
artifact emptySourcesJar | ||
artifact emptyJavadocJar | ||
} | ||
} | ||
} |
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,4 @@ | ||
POM_ARTIFACT_ID=layoutlib-native-win | ||
POM_NAME=Native Android Runtime for Windows | ||
POM_DESCRIPTION=Android runtime for Windows, fonts, and ICU data, packaged for Paparazzi | ||
POM_PACKAGING=jar |
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