Repository: uber/stylist Branch: master Commit: e198d4bde23d Files: 64 Total size: 128.6 KB Directory structure: gitextract_zfjguc9g/ ├── .buildscript/ │ └── deploy_snapshot.sh ├── .editorconfig ├── .github/ │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── RELEASING.md ├── build.gradle ├── buildSrc/ │ ├── build.gradle │ └── settings.gradle ├── config/ │ ├── checkstyle/ │ │ ├── checkstyle-suppressions.xml │ │ ├── checkstyle-test.xml │ │ └── checkstyle.xml │ └── lint/ │ └── lint.xml ├── gradle/ │ ├── checkstyle.gradle │ ├── dependencies.gradle │ ├── gradle-mvn-push.gradle │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── sample/ │ ├── app/ │ │ ├── build.gradle │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── uber/ │ │ │ └── stylist/ │ │ │ └── myapplication/ │ │ │ └── MainActivity.java │ │ └── res/ │ │ ├── drawable/ │ │ │ └── divider.xml │ │ ├── layout/ │ │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26/ │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ └── values/ │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml │ ├── library/ │ │ ├── build.gradle │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── uber/ │ │ │ └── stylist/ │ │ │ └── mylibrary/ │ │ │ └── MyUtils.java │ │ └── res/ │ │ └── values/ │ │ ├── attrs.xml │ │ └── strings.xml │ └── providers/ │ ├── build.gradle │ └── src/ │ └── main/ │ └── java/ │ └── com/ │ └── uber/ │ └── stylist/ │ └── myproviders/ │ └── SampleThemeStencilProvider.java ├── settings.gradle ├── stylist/ │ ├── build.gradle │ ├── gradle.properties │ └── src/ │ └── main/ │ ├── kotlin/ │ │ └── com/ │ │ └── uber/ │ │ └── stylist/ │ │ ├── StylistExtension.kt │ │ ├── StylistPlugin.kt │ │ ├── StylistTask.kt │ │ └── internal/ │ │ └── util/ │ │ └── Util.kt │ └── resources/ │ └── META-INF/ │ └── gradle-plugins/ │ └── com.uber.stylist.properties ├── stylist-api/ │ ├── build.gradle │ ├── gradle.properties │ └── src/ │ └── main/ │ └── kotlin/ │ └── com/ │ └── uber/ │ └── stylist/ │ └── api/ │ ├── StyleItem.kt │ ├── StyleItemGroup.kt │ ├── ThemeStencil.kt │ ├── ThemeStencilProvider.kt │ └── ThemeStencilService.kt └── stylist-core/ ├── build.gradle ├── gradle.properties └── src/ ├── main/ │ └── kotlin/ │ └── com/ │ └── uber/ │ └── stylist/ │ └── Stylist.kt └── test/ └── kotlin/ └── com/ └── uber/ └── stylist/ └── StylistTest.kt ================================================ FILE CONTENTS ================================================ ================================================ FILE: .buildscript/deploy_snapshot.sh ================================================ #!/bin/bash # # Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo. # # Adapted from https://coderwall.com/p/9b_lfq and # http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ SLUG="uber/stylist" JDK="oraclejdk8" BRANCH="master" set -e if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'." elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'." elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo "Skipping snapshot deployment: was pull request." elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'." else echo "Deploying snapshot..." ./gradlew clean uploadArchives -Dorg.gradle.parallel=false echo "Snapshot deployed!" fi ================================================ FILE: .editorconfig ================================================ [*.{kt,kts}] # possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely) indent_size=2 continuation_indent_size=4 insert_final_newline=true # possible values: number (e.g. 120) (package name, imports & comments are ignored), "off" max_line_length=off ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ Thanks for using Stylist. Before you create an issue, please consider the following points: - [ ] If you think you found a bug, please include a code sample that reproduces the problem. A test case that reproduces the issue is preferred. A stack trace alone is ok but may not contain enough context for us to address the issue. - [ ] Please include the library version number, including the minor and patch version, in the issue text. ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ Thank you for contributing to Stylist. Before pressing the "Create Pull Request" button, please provide the following: - [ ] A description about what and why you are contributing, even if it's trivial. - [ ] The issue number(s) or PR number(s) in the description if you are contributing in response to those. - [ ] If applicable, unit tests. ================================================ FILE: .gitignore ================================================ ###OSX### .DS_Store .AppleDouble .LSOverride # Icon must ends with two \r. Icon # Thumbnails ._* # Files that might appear on external disk .Spotlight-V100 .Trashes ###Linux### *~ # KDE directory preferences .directory ###Android### # Built application files *.apk *.ap_ # Files for ART and Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ # Gradle files .gradle/ .gradletasknamecache build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Eclipse proguard/ # Lint lint-report.html lint-report_files/ lint_result.txt # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.war *.ear # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* ###IntelliJ### *.iml *.ipr *.iws .idea/ ###Eclipse### *.pydevproject .metadata tmp/ *.tmp *.bak *.swp *~.nib .settings/ .loadpath # External tool builders .externalToolBuilders/ # Locally stored "Eclipse launch configurations" *.launch # CDT-specific .cproject # PDT-specific .buildpath # sbteclipse plugin .target # TeXlipse plugin .texlipse # kotlin annotations/ ================================================ FILE: .travis.yml ================================================ language: android android: components: - tools - platform-tools - build-tools-28.0.3 - android-28 - extra-android-m2repository jdk: - oraclejdk8 script: - ./gradlew assembleDebug test check after_success: - .buildscript/deploy_snapshot.sh env: global: - secure: UiOM+Qr3ghDO6QyWmXcPpBmbuBe80OqLBM6+g7r+elbWjLgcsvaS4tsOuPJnvX+SSzgrUnMJLruzw0w7JXDGCtDsxR/ygN5+C/YkjVjEA0qyCDaTnJQVh9tYVwBy4zbaSaRFMVAxleBQwR1OjMetLMMTsOR8q7YpUt1I6AJzcQGUscobbEOks7TiWUNX21kDzjWbyV5sC/xPx52uAi4SVJJosExlnRz8THGBSTl7COMxE4yw5XksDw/BYDi8A8y21GP0tqgo8wdE3NTpfdMylhkOMwL5cYBAjxudAWn8XtfG54pRYjyFjdgQpKNcDM2JLUE7IjQ+DrC2DvjMKaATWHmohGOZZmb4gYCONoLZyR4UsnMObvKFpooc8401wHxPZ3Yk4vFNMJH1Nik/KsCnV0PITPVrEn135XVsjdwkR8Ntl7f2DVqOHfJrJhEtU+QnSQhAOK5+S/TAGPVlbRhDKpLxfnMZh61tqgfZFBqWFsDtmuq4B8A/FmffFzPstzMWv+/sp6xAXgVfK+UvSBGifm3RgayXpO4qDi7nt38w2lyhQVtgrXLtZVqBKGzvRJRIAQgoe8MJprbU2z90xKPj8smkOMkIGAsdbSEgyC3QrrJMWGKv1rFfpZT7AhyVRsZlb4FAEKEInE0MCRudMWRdI8S+X+rqbRXaQQvwCkd/DXA= - secure: Fo9GFxUsipCp5n4KuOK8ap6NTEV9Vt8a8dqUi+/ZgQQcFeNEUhg79h88DnVxTUZTVfB4VNWz5L2uOdhNIcBn3UCkW+I56obDc4VC85QJoZCOyagTQueLLExcklLdxyTMK2577d8P9bVsqLX7oNfnGI7y/6Z2Vh5u/kNfOOR6GkeFuP9ptX34TrCv0JDBrwuBgCPz+/daDiFFEpNDjGahWjSIZ8rs91gh4QGIWZk1tq3czP+3Biuj6Urk78RFO+UM9QlXk0Ayl6brodjGCjlRzjITzkKWaD7o+mw1EDRimkgTT0HwiiSEJJgQhxPwyIL4M4r7cKLUmx86FEgVtLY/tOcylNwYWEsotW4NIeiWZDG4kOFZQjoBhsvzGgS23r9aUQi03eYjDQ2SDTurH/DSe2IEm6BVaDDBOIA88FoU040TbiSf59OwSic1S+UlMRGUxmG/r69g+RVG6CZMUxTI2ypHtpAK3Sv2oR7GNcIOeAciwDCuNATBy60x13zyWnXI0mbmFBe7o0YqqwCO4ANxCX9agNdQ7E5IqdHZv7TF7DZfVo2skmyM4DI1oRN82icCDdw1QmdIfw2okq4D5c2Deuc0gRnZU/iXIUgKenkxcnjd0BeUUHe4eioR4ihCSHqwkIyI/zWYIaekRQ8Lz3w+ov2XKK1zCqeMcN+9OcroWkc= branches: except: - gh-pages notifications: email: false cache: directories: - $HOME/.gradle ================================================ FILE: CHANGELOG.md ================================================ Changelog ========= Version 0.0.2 ------------- _2018-12-03_ * **Breaking change:** Project migrated to [AndroidX](https://developer.android.com/jetpack/androidx/). See the [class and package mappings](https://developer.android.com/jetpack/androidx/migrate) for help migrating * **Breaking change:** `com.commit451.uresourcespoet.StyleItem` moved to `com.uber.stylist.api.StyleItem` Version 0.0.1 ------------- _2018-08-22_ * Initial release ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mobile-open-source@uber.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: CONTRIBUTING.md ================================================ Contributing to Uber's Android Template ======================= Uber welcomes contributions of all kinds and sizes. This includes everything from from simple bug reports to large features. Workflow -------- We love GitHub issues! For small feature requests, an issue first proposing it for discussion or demo implementation in a PR suffice. For big features, please open an issue so that we can agree on the direction, and hopefully avoid investing a lot of time on a feature that might need reworking. Small pull requests for things like typos, bug fixes, etc are always welcome. DOs and DON'Ts -------------- * DO follow our [coding style](https://github.com/uber/java-code-styles) * DO include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken. * DO keep the discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the discussion. * DON'T submit PRs that alter licensing related files or headers. If you believe there's a problem with them, file an issue and we'll be happy to discuss it. Guiding Principles ------------------ * We allow anyone to participate in our projects. Tasks can be carried out by anyone that demonstrates the capability to complete them * Always be respectful of one another. Assume the best in others and act with empathy at all times * Collaborate closely with individuals maintaining the project or experienced users. Getting ideas out in the open and seeing a proposal before it's a pull request helps reduce redundancy and ensures we're all connected to the decision making process ================================================ FILE: LICENSE.txt ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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. ================================================ FILE: README.md ================================================ # Stylist [![Build Status](https://travis-ci.org/uber/stylist.svg?branch=master)](https://travis-ci.org/uber/stylist) As Android apps grow, providing common styling across app themes becomes challenging. Typically, this results in copy-pasting style items across themes, monolithic themes, or complicated inheritance trees. Stylist is a highly-extensible platform for creating and maintaining an app’s base set of Android XML themes. ## Overview Stylist is a Gradle plugin written in Kotlin that generates a base set of Android XML themes. Stylist-generated themes are created using a stencil and trait system. Each theme is declared with a single stencil, which is comprised of sets of logically-grouped style items. All of this comes together to create an easily maintainable system of stencils and traits. *ThemeStencils*: A 1:1 ratio of `ThemeStencil`s to corresponding generated themes. Each `ThemeStencil` declares a theme name and parent theme plus any extra `StyleItemGroup`s that should be included in addition to the globally applicable set. *StyleItemGroups*: Each `StyleItemGroup` can be declared by multiple `ThemeStencil`s and generate otherwise duplicated style items across all themes that include them. Common examples include default app colors, font sizes, and common dimension values. They are a logical groupings of custom theme attributes that get included in each theme that declares the group. ## Usage A simple `ThemeStencilProvider` that defines text sizes in Dark and Light themes would look like: ```kotlin @AutoService(ThemeStencilProvider::class) class SampleThemeStencilProvider : ThemeStencilProvider { private val textSizes = StyleItemGroup( StyleItem("textSizeSmall", "12dp"), StyleItem("textSizeMedium","16dp"), StyleItem("textSizeLarge", "20dp") ) override fun stencils() = linkedSetOf( ThemeStencil("Theme.Sample.Dark", "Theme.AppCompat"), ThemeStencil("Theme.Sample.Light", "Theme.AppCompat.Light") ) override fun globalStyleItemGroups() = linkedSetOf( textSizes ) } ``` Leaving you with a generated themes XML resource file like this: ```xml ``` This may look like a lot of boilerplate for simple style item shared by two themes, but it scales quite well when you want to have many custom color, dimension, and other style items on _numerous_ app themes and custom theme attributes. ## Download Stylist [![Maven Central](https://img.shields.io/maven-central/v/com.uber.stylist/stylist.svg)](https://mvnrepository.com/artifact/com.uber.stylist/stylist) ```gradle classpath 'com.uber.stylist:stylist:0.0.2' ``` Stylist Core [![Maven Central](https://img.shields.io/maven-central/v/com.uber.stylist/stylist-core.svg)](https://mvnrepository.com/artifact/com.uber.stylist/stylist-core) ```gradle classpath 'com.uber.stylist:stylist-core:0.0.2' ``` Stylist API [![Maven Central](https://img.shields.io/maven-central/v/com.uber.stylist/stylist-api.svg)](https://mvnrepository.com/artifact/com.uber.stylist/stylist-api) ```gradle classpath 'com.uber.stylist:stylist-api:0.0.2' ``` ## License ``` Copyright (C) 2018 Uber Technologies 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. ``` ================================================ FILE: RELEASING.md ================================================ Releasing ========= 1. Change the version in `gradle.properties` to a non-SNAPSHOT version. 2. Update the `CHANGELOG.md` for the impending release. 3. Update the `README.md` with the new version. 4. `git commit -am "Prepare for release X.Y.Z"` (where X.Y.Z is the new version) 5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version) 6. `./gradlew clean uploadArchives -Dorg.gradle.parallel=false` 7. Update the `gradle.properties` to the next SNAPSHOT version. 8. `git commit -am "Prepare next development version"` 9. `git push && git push --tags` 10. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact. ================================================ FILE: build.gradle ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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 { apply from: project.file('gradle/dependencies.gradle') repositories { google() jcenter() maven { url deps.build.gradlePluginsUrl } } dependencies { classpath deps.build.androidPlugin classpath deps.kotlin.gradlePlugin } } apply from: project.file('gradle/dependencies.gradle') subprojects { buildscript { repositories { google() jcenter() } } repositories { google() jcenter() maven { url deps.build.gradlePluginsUrl } } apply plugin: 'checkstyle' checkstyle { -> rootProject configFile rootProject.file('config/checkstyle/checkstyle.xml') } } task wrapper(type: Wrapper) { gradleVersion = '4.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } task clean(type: Delete) { rootProject.allprojects { delete it.buildDir } } apply from: 'gradle/dependencies.gradle' apply from: 'gradle/checkstyle.gradle' ================================================ FILE: buildSrc/build.gradle ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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 { apply from: project.rootProject.file("../gradle/dependencies.gradle") repositories { google() jcenter() maven { url deps.build.gradlePluginsUrl } } dependencies { classpath deps.build.androidPlugin classpath deps.kotlin.gradlePlugin } } apply from: project.rootProject.file("../gradle/dependencies.gradle") repositories { google() jcenter() } subprojects { subproject -> if (subproject.buildFile.exists()) { apply from: project.rootProject.file("../gradle/dependencies.gradle") repositories { google() jcenter() } rootProject.dependencies { runtime project(path) } } subproject.afterEvaluate { // Disable useless tasks in buildSrc if (subproject.plugins.hasPlugin("kotlin")) { subproject.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions.suppressWarnings = true } } subproject.tasks.findAll { it.name.toLowerCase().contains("test") || it.name.toLowerCase().contains("lint") || it.name.toLowerCase().contains("checkstyle") }.each { it.enabled = false } } } ================================================ FILE: buildSrc/settings.gradle ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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. */ // These are not needed if consuming the Stylist plugin from Maven Central instead of the local copy from this repo include ':stylist' include ':stylist-api' include ':stylist-core' include ':sample:providers' ================================================ FILE: config/checkstyle/checkstyle-suppressions.xml ================================================ ================================================ FILE: config/checkstyle/checkstyle-test.xml ================================================ ================================================ FILE: config/checkstyle/checkstyle.xml ================================================ ================================================ FILE: config/lint/lint.xml ================================================ ================================================ FILE: gradle/checkstyle.gradle ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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. */ subprojects { buildscript { repositories { jcenter() } } repositories { jcenter() maven { url 'https://maven.google.com' } } apply plugin: 'checkstyle' afterEvaluate { def checkstyleConfig = rootProject.file('config/checkstyle/checkstyle.xml') if (project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library')) { task checkstyleMain(type: Checkstyle) { ignoreFailures = false showViolations = true source 'src/main', 'src/release' include '**/*.java' exclude '**/gen/**' exclude '**/R.java' exclude '**/BuildConfig.java' reports { xml.destination "$project.buildDir/reports/checkstyle/main.xml" } classpath = files() configFile = checkstyleConfig } task checkstyleTest(type: Checkstyle){ ignoreFailures = false showViolations = true source 'src/test', 'src/androidTest' include '**/*.java' exclude '**/gen/**' exclude '**/R.java' exclude '**/BuildConfig.java' reports { xml.destination "$project.buildDir/reports/checkstyle/test.xml" } classpath = files() configFile = checkstyleConfig } task checkstyle(dependsOn:['checkstyleMain', 'checkstyleTest']){ description 'Runs Checkstyle inspection against Android sourcesets.' group = 'Code Quality' } project.tasks.getByName("check").dependsOn "checkstyle" } else { checkstyle { ignoreFailures = false showViolations = true configFile checkstyleConfig } } tasks.withType(Checkstyle) { configProperties = ['proj.module.dir' : projectDir.absolutePath, 'checkstyle.cache.file': './build/cache/checkstyle-cache'] } } } ================================================ FILE: gradle/dependencies.gradle ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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. */ def versions = [ kotlin : "1.3.10" ] def androidx = [ annotations : "androidx.annotation:annotation:1.0.0", appcompat : "androidx.appcompat:appcompat:1.0.0", constraintLayout : "androidx.constraintlayout:constraintlayout:1.1.2" ] def apt = [ autoService : "com.google.auto.service:auto-service:1.0-rc4" ] def build = [ androidPlugin : "com.android.tools.build:gradle:3.2.1", buildToolsVersion : "28.0.3", compileSdkVersion : 28, ci: 'true' == System.getenv('CI'), googleJavaFormatter : "com.google.googlejavaformat:google-java-format:1.4", gradleAptPlugin : "net.ltgt.gradle:gradle-apt-plugin:0.18", gradlePluginsUrl : "https://plugins.gradle.org/m2/", minSdkVersion : 19, targetSdkVersion : 28 ] def external = [ resourcesPoet : "com.commit451:resourcespoet:2.1.0" ] def kotlin = [ gradlePlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}", stdLibJdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}", stdLibJdk8 : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}" ] def test = [ junit : 'junit:junit:4.12', truth : "com.google.truth:truth:0.40" ] ext.deps = [ "androidx" : androidx, "apt" : apt, "build" : build, "external" : external, "kotlin" : kotlin, "test" : test, "versions" : versions ] ================================================ FILE: gradle/gradle-mvn-push.gradle ================================================ /* * Copyright (C) Chris Banes * * 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. */ apply plugin: 'maven' apply plugin: 'signing' version = VERSION_NAME group = GROUP def isReleaseBuild() { return VERSION_NAME.contains("SNAPSHOT") == false } def getReleaseRepositoryUrl() { return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" } def getSnapshotRepositoryUrl() { return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL : "https://oss.sonatype.org/content/repositories/snapshots/" } def getRepositoryUsername() { return hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : "" } def getRepositoryPassword() { return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : "" } afterEvaluate { project -> uploadArchives { repositories { mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } pom.groupId = GROUP pom.artifactId = POM_ARTIFACT_ID pom.version = VERSION_NAME repository(url: getReleaseRepositoryUrl()) { authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) } snapshotRepository(url: getSnapshotRepositoryUrl()) { authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) } pom.project { name POM_NAME packaging POM_PACKAGING description POM_DESCRIPTION url POM_URL scm { url POM_SCM_URL connection POM_SCM_CONNECTION developerConnection POM_SCM_DEV_CONNECTION } licenses { license { name POM_LICENCE_NAME url POM_LICENCE_URL distribution POM_LICENCE_DIST } } developers { developer { id POM_DEVELOPER_ID name POM_DEVELOPER_NAME } } } } } } signing { required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } sign configurations.archives } if (project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library')) { task install(type: Upload, dependsOn: assemble) { repositories.mavenInstaller { configuration = configurations.archives pom.groupId = GROUP pom.artifactId = POM_ARTIFACT_ID pom.version = VERSION_NAME pom.project { name POM_NAME packaging POM_PACKAGING description POM_DESCRIPTION url POM_URL scm { url POM_SCM_URL connection POM_SCM_CONNECTION developerConnection POM_SCM_DEV_CONNECTION } licenses { license { name POM_LICENCE_NAME url POM_LICENCE_URL distribution POM_LICENCE_DIST } } developers { developer { id POM_DEVELOPER_ID name POM_DEVELOPER_NAME } } } } } task androidJavadocs(type: Javadoc) { if (!project.plugins.hasPlugin('kotlin-android')) { source = android.sourceSets.main.java.srcDirs } classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) exclude '**/internal/*' if (JavaVersion.current().isJava8Compatible()) { options.addStringOption('Xdoclint:none', '-quiet') } } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { classifier = 'javadoc' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { classifier = 'sources' from android.sourceSets.main.java.sourceFiles } } else { install { repositories.mavenInstaller { pom.groupId = GROUP pom.artifactId = POM_ARTIFACT_ID pom.version = VERSION_NAME pom.project { name POM_NAME packaging POM_PACKAGING description POM_DESCRIPTION url POM_URL scm { url POM_SCM_URL connection POM_SCM_CONNECTION developerConnection POM_SCM_DEV_CONNECTION } licenses { license { name POM_LICENCE_NAME url POM_LICENCE_URL distribution POM_LICENCE_DIST } } developers { developer { id POM_DEVELOPER_ID name POM_DEVELOPER_NAME } } } } } task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } } if (JavaVersion.current().isJava8Compatible()) { allprojects { tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') } } } artifacts { if (project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library')) { archives androidSourcesJar archives androidJavadocsJar } else { archives sourcesJar archives javadocJar } } } ================================================ FILE: gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================ FILE: gradle.properties ================================================ # # Copyright (c) 2018. Uber Technologies # # 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. # # Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true GROUP=com.uber.stylist VERSION_NAME=0.0.3-SNAPSHOT POM_DESCRIPTION=A Gradle plugin that generates a base set of XML themes POM_URL=https://github.com/uber/stylist/ POM_SCM_URL=https://github.com/uber/stylist/ POM_SCM_CONNECTION=scm:git:git://github.com/uber/stylist.git POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/uber/stylist.git POM_LICENCE_NAME=The Apache Software License, Version 2.0 POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt POM_LICENCE_DIST=repo POM_DEVELOPER_ID=uber POM_DEVELOPER_NAME=Uber Technologies android.useAndroidX=true android.enableJetifier=true ================================================ FILE: gradlew ================================================ #!/usr/bin/env sh ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn () { echo "$*" } die () { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "$@" ================================================ FILE: sample/app/build.gradle ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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. */ apply plugin: 'com.android.application' android { compileSdkVersion deps.build.compileSdkVersion buildToolsVersion deps.build.buildToolsVersion defaultConfig { applicationId "com.uber.stylist.myapplication" minSdkVersion deps.build.minSdkVersion targetSdkVersion deps.build.targetSdkVersion versionCode 1 versionName "1.0" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } // Setup a simple lint config for an android app/library. lintOptions { abortOnError true lintConfig rootProject.file('config/lint/lint.xml') } } dependencies { implementation project(":sample:library") implementation deps.androidx.appcompat implementation deps.androidx.constraintLayout } ================================================ FILE: sample/app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: sample/app/src/main/java/com/uber/stylist/myapplication/MainActivity.java ================================================ /* * Copyright (c) 2018. Uber Technologies * * 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. */ package com.uber.stylist.myapplication; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; /** * Sample activity. */ public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } ================================================ FILE: sample/app/src/main/res/drawable/divider.xml ================================================ ================================================ FILE: sample/app/src/main/res/layout/activity_main.xml ================================================