├── .gitignore ├── CHANGE-LOG.md ├── LICENSE ├── README.md ├── README_PUBLISH.md ├── README_module作为app独立运行.md ├── README_pin工程处理.md ├── README_代码多平台复用.md ├── README_批量发布library到maven仓库.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── galaxybruce │ │ └── poinner │ │ └── ExampleInstrumentedTest.java │ ├── app1 │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── galaxybruce │ │ │ └── pionner │ │ │ └── demo │ │ │ └── AppActivity_1.java │ └── res │ │ ├── layout │ │ └── app_layout_1.xml │ │ └── values │ │ └── strings.xml │ ├── app2 │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── galaxybruce │ │ │ └── pionner │ │ │ └── demo │ │ │ └── AppActivity_1.java │ └── res │ │ ├── layout │ │ └── app_layout_1.xml │ │ └── values │ │ └── strings.xml │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── galaxybruce │ │ │ └── poinner │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── content_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── galaxybruce │ └── poinner │ └── ExampleUnitTest.java ├── assembleMaven ├── assets └── btn_apache_lisence.png ├── build.gradle ├── gradle.properties ├── gradle ├── publish.gradle ├── upload_maven.gradle ├── util.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── mutilplatform.png ├── pin.png ├── run_as_app_for_component1.png └── run_as_app_for_component2.png ├── modulemaven.json ├── pioneer-gradle-plugin ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── groovy │ └── com │ │ └── galaxybruce │ │ └── pioneer │ │ ├── PioneerExtension.groovy │ │ ├── PioneerPlugin.groovy │ │ ├── PioneerSettingsPlugin.groovy │ │ ├── aar │ │ └── AARDependency.groovy │ │ ├── copy │ │ └── ProjectCopyOutputManager.groovy │ │ ├── flutter │ │ └── FlutterHandler.groovy │ │ ├── manifest │ │ ├── PlatformSourceUtil.groovy │ │ └── ProjectManifestMerger.groovy │ │ ├── maven │ │ ├── MavenInfo.groovy │ │ ├── MavenUploadManager.groovy │ │ └── ModuleInfo.groovy │ │ ├── run_module │ │ ├── ProjectModuleCache.groovy │ │ └── ProjectModuleManager.groovy │ │ └── utils │ │ ├── GitUtil.groovy │ │ ├── LogUtil.groovy │ │ ├── Utils.groovy │ │ └── runtime │ │ ├── ExecuteResult.java │ │ ├── LocalCommandExecutor.java │ │ ├── LocalCommandExecutorImpl.java │ │ ├── RunTimeTask.java │ │ └── StreamGobbler.java │ └── resources │ └── META-INF │ └── gradle-plugins │ ├── galaxybruce-pioneer-settings.properties │ └── galaxybruce-pioneer.properties ├── repo-local └── com │ └── galaxybruce │ ├── android │ └── pioneer-gradle-plugin │ │ ├── 0.1.2 │ │ ├── pioneer-gradle-plugin-0.1.2-javadoc.jar │ │ ├── pioneer-gradle-plugin-0.1.2-javadoc.jar.md5 │ │ ├── pioneer-gradle-plugin-0.1.2-javadoc.jar.sha1 │ │ ├── pioneer-gradle-plugin-0.1.2-javadoc.jar.sha256 │ │ ├── pioneer-gradle-plugin-0.1.2-javadoc.jar.sha512 │ │ ├── pioneer-gradle-plugin-0.1.2-sources.jar │ │ ├── pioneer-gradle-plugin-0.1.2-sources.jar.md5 │ │ ├── pioneer-gradle-plugin-0.1.2-sources.jar.sha1 │ │ ├── pioneer-gradle-plugin-0.1.2-sources.jar.sha256 │ │ ├── pioneer-gradle-plugin-0.1.2-sources.jar.sha512 │ │ ├── pioneer-gradle-plugin-0.1.2.jar │ │ ├── pioneer-gradle-plugin-0.1.2.jar.md5 │ │ ├── pioneer-gradle-plugin-0.1.2.jar.sha1 │ │ ├── pioneer-gradle-plugin-0.1.2.jar.sha256 │ │ ├── pioneer-gradle-plugin-0.1.2.jar.sha512 │ │ ├── pioneer-gradle-plugin-0.1.2.module │ │ ├── pioneer-gradle-plugin-0.1.2.module.md5 │ │ ├── pioneer-gradle-plugin-0.1.2.module.sha1 │ │ ├── pioneer-gradle-plugin-0.1.2.module.sha256 │ │ ├── pioneer-gradle-plugin-0.1.2.module.sha512 │ │ ├── pioneer-gradle-plugin-0.1.2.pom │ │ ├── pioneer-gradle-plugin-0.1.2.pom.md5 │ │ ├── pioneer-gradle-plugin-0.1.2.pom.sha1 │ │ ├── pioneer-gradle-plugin-0.1.2.pom.sha256 │ │ └── pioneer-gradle-plugin-0.1.2.pom.sha512 │ │ ├── maven-metadata.xml │ │ ├── maven-metadata.xml.md5 │ │ ├── maven-metadata.xml.sha1 │ │ ├── maven-metadata.xml.sha256 │ │ └── maven-metadata.xml.sha512 │ └── testlibrary-app2 │ ├── 1.0.1-SNAPSHOT │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ ├── maven-metadata.xml.sha1 │ ├── maven-metadata.xml.sha256 │ ├── maven-metadata.xml.sha512 │ ├── testlibrary-app2-1.0.1-20221026.044255-1-sources.jar │ ├── testlibrary-app2-1.0.1-20221026.044255-1-sources.jar.md5 │ ├── testlibrary-app2-1.0.1-20221026.044255-1-sources.jar.sha1 │ ├── testlibrary-app2-1.0.1-20221026.044255-1-sources.jar.sha256 │ ├── testlibrary-app2-1.0.1-20221026.044255-1-sources.jar.sha512 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.aar │ ├── testlibrary-app2-1.0.1-20221026.044255-1.aar.md5 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.aar.sha1 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.aar.sha256 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.aar.sha512 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.module │ ├── testlibrary-app2-1.0.1-20221026.044255-1.module.md5 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.module.sha1 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.module.sha256 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.module.sha512 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.pom │ ├── testlibrary-app2-1.0.1-20221026.044255-1.pom.md5 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.pom.sha1 │ ├── testlibrary-app2-1.0.1-20221026.044255-1.pom.sha256 │ └── testlibrary-app2-1.0.1-20221026.044255-1.pom.sha512 │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ ├── maven-metadata.xml.sha1 │ ├── maven-metadata.xml.sha256 │ └── maven-metadata.xml.sha512 ├── settings.gradle └── testlibrary ├── .gitignore ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src ├── AndroidManifest.xml ├── androidTest └── java │ └── com │ └── galaxybruce │ └── testlibrary │ └── ExampleInstrumentedTest.java ├── debug-test ├── AndroidManifest.xml ├── build.gradle ├── java │ └── debug │ │ ├── MyApp.java │ │ └── activity │ │ └── MainActivity.java └── res │ ├── layout │ └── main_layout.xml │ ├── mipmap-xhdpi │ └── demo_b_ic_launcher.png │ └── strings.xml ├── p_lib1 ├── app1 │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── galaxybruce │ │ │ └── testlibrary │ │ │ └── Lib1Activity_2.java │ └── res │ │ ├── layout │ │ └── lib1_layout_2.xml │ │ └── values │ │ └── strings.xml ├── app2 │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── galaxybruce │ │ │ └── testlibrary │ │ │ ├── GFileProvider.java │ │ │ └── Lib1Activity_2.java │ └── res │ │ ├── layout │ │ └── lib1_layout_2.xml │ │ ├── values │ │ └── strings.xml │ │ └── xml │ │ └── galaxybruce_provider_paths.xml ├── build.gradle ├── libs │ └── Msc.jar └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── galaxybruce │ │ └── testlibrary │ │ └── Lib1Activity_1.java │ └── res │ ├── layout │ └── lib1_layout.xml │ └── values │ └── strings.xml ├── p_lib2 └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── galaxybruce │ │ └── testlibrary │ │ └── LibActivity2.java │ └── res │ ├── layout │ └── lib2_layout.xml │ └── values │ └── strings.xml └── test └── java └── com └── galaxybruce └── testlibrary └── ExampleUnitTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea/ 4 | /local.properties 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .MWebMetaData/ 16 | -------------------------------------------------------------------------------- /CHANGE-LOG.md: -------------------------------------------------------------------------------- 1 | ## 更新日志 2 | 3 | * 0.1.0 `2022/08/14` 4 | * [1] 增加新feature: module作为app独立运行 5 | 6 | * 0.0.1 `2019/03/29` 7 | * [1] 增加feature: pin工程处理 8 | * [2] 增加feature: 代码多平台复用 9 | * [3] 增加feature: 批量发布library到maven仓库 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2018 bruce.zhang 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | AndroidPioneer是一个汇集Android工程编译相关的gradle插件。 3 | 4 | ## bintray-release [![Download](https://img.shields.io/badge/version-0.0.26-blue.svg)](https://bintray.com/galaxybruce/maven/pioneer-gradle-plugin/_latestVersion) [![](./assets/btn_apache_lisence.png)](LICENSE) 5 | 6 | ### 目前有以下功能: 7 | * [module作为app独立运行](https://github.com/galaxybruce/AndroidPionner/blob/master/README_module%E4%BD%9C%E4%B8%BAapp%E7%8B%AC%E7%AB%8B%E8%BF%90%E8%A1%8C.md) 8 | * [pin工程处理](https://github.com/galaxybruce/AndroidPionner/blob/master/README_pin%E5%B7%A5%E7%A8%8B%E5%A4%84%E7%90%86.md) 9 | * [代码多平台复用](https://github.com/galaxybruce/AndroidPionner/blob/master/README_%E4%BB%A3%E7%A0%81%E5%A4%9A%E5%B9%B3%E5%8F%B0%E5%A4%8D%E7%94%A8.md) 10 | * [批量发布library到maven仓库](https://github.com/galaxybruce/AndroidPionner/blob/master/README_%E6%89%B9%E9%87%8F%E5%8F%91%E5%B8%83library%E5%88%B0maven%E4%BB%93%E5%BA%93.md) 11 | 12 | -------------------------------------------------------------------------------- /README_PUBLISH.md: -------------------------------------------------------------------------------- 1 | ### 发布 2 | * 发布到local maven(.m2目录): ./gradlew :pioneer-gradle-plugin:publishToMavenLocal 3 | * 发布到remote maven或者指定目录: ./gradlew :pioneer-gradle-plugin:publish 4 | * 参考文章:https://juejin.cn/post/6844904185754812423 5 | 6 | ### 发布到jcenter,在项目根目录依次输入下面两个命令 7 | * ./gradlew install 8 | * ./gradlew bintrayUpload 9 | 10 | ### 发布到jcenter参考文章 11 | https://blog.csdn.net/linglongxin24/article/details/53415932 12 | 13 | 还有一篇宣传极简文章:https://juejin.im/post/59cef9baf265da066a105f92 14 | 15 | 也可以像arouter那样把install和bintray拆封成两个文件install.gradle和bintray.gradle 16 | 17 | butterknife中对android和java包做了区分,值得参考 https://github.com/JakeWharton/butterknife/blob/master/gradle/gradle-mvn-push.gradle 18 | -------------------------------------------------------------------------------- /README_module作为app独立运行.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | `module作为app独立运行`是组件化开发中最基本的一个环节,适合团队规模不大,module在一个工程中的情况(团队非常大的情况,建议采用插件化的方式,每个业务独立为一个工程开发)。 3 | 4 | ### 效果图 5 | ![run_as_app_for_component1.png](images/run_as_app_for_component1.png) 6 | 7 | ### 使用方式 8 | 9 | #### 1. 该功能默认是关闭的,如需开启,在 local.properties 中增加 10 | ``` 11 | RUN_AS_APP_FOR_COMPONENT=true 12 | ``` 13 | 14 | #### 2. 每个module的build.gradle最顶部添加 15 | ``` 16 | apply plugin: 'galaxybruce-pioneer' 17 | ``` 18 | 19 | #### 3. 每个module的src目录下增加 debug-test 目录 20 | 目录结构如下,参考 `testlibrary` module 21 | 22 | ![run_as_app_for_component2.png](images/run_as_app_for_component2.png) 23 | 24 | 每个文件作用: 25 | * MyApp - 运行该module需要的最简初始化代码 26 | * MainActivity - 简单的入口(一般有两个按钮,一个登录,一个进入该模块功能) 27 | * AndroidManifest.xml - 配置MyApp以及MainActivity 28 | * build.gradle - 增加module独立运行时需要的额外依赖 29 | 30 | #### 4. 暴露给外面的属性 31 | * androidPluginApplied 32 | androidPluginApplied属性表示插件内部已经apply application或者library插件,外层可以根据该属性做些处理,如: 33 | ``` 34 | if (!(project.ext.has('androidPluginApplied') && project.ext.androidPluginApplied)) { 35 | apply plugin: "com.android.library" 36 | } 37 | ``` 38 | 39 | * runAsApp 40 | runAsApp属性表示该module是否已经apply application,外层可以根据这个属性做些处理,比如添加额外依赖 41 | ``` 42 | if (!(project.ext.has('runAsApp') && project.ext.runAsApp)) { 43 | 44 | } 45 | ``` 46 | 47 | * assembleThisModule 48 | assembleThisModule表示该module正在独立运行 49 | -------------------------------------------------------------------------------- /README_pin工程处理.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | `pin工程处理`是在一个module中把业务进一步细化成更小的工程结构。具有以下优势: 3 | * 业务模块中进一步隔离代码和资源 4 | * 方便实验性代码的隔离和删除 5 | * 把相似业务作为pin工程放在一个module中,相比较作为一个module来说,编译速度更快 6 | 7 | ps: pin工程概念建议参考这篇文章[微信Android模块化架构重构实践](https://www.jianshu.com/p/3990724aa7e4) 8 | 9 | ### 使用方式 10 | #### 1. 插件默认开启pin工程支持,无需做任何配置 11 | #### 2. 在module的build.gradle中添加 12 | ``` 13 | apply plugin: 'galaxybruce-pioneer' 14 | ``` 15 | #### 3. pin工程目录约定都已p_开头,否则无法识别 16 | * 3.1 pin工程的目录结构与普通的module结构一模一样 17 | * 3.2 pin工程下可以设置独立的build.gradle,但是该build.gradle中不允许apply plugin: 'com.android.library' 18 | ![pin.png](images/pin.png) 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /README_代码多平台复用.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | `代码多平台复用`是指同一份代码支持差异化打包,配置不同的平台标识,运行差异化代码。 3 | 4 | ps: 多平台复用是可以和pin工程结合使用的 5 | 6 | ### 多平台项目结构介绍 7 | ![多平台项目结构](./images/mutilplatform.png) 8 | 9 | * app1目录中只存放在app1上运行有差异化的代码 10 | * app2目录中只存放在app2上运行有差异化的代码 11 | * main目录中就是共用部分的代码 12 | 13 | ### 使用方式 14 | #### 1. 插件默认支持多平台复用,无需额外配置 15 | 16 | #### 2. 在module的build.gradle中添加 17 | ``` 18 | apply plugin: 'galaxybruce-pioneer' 19 | ``` 20 | 21 | #### 3. 根目录下的build.gradle中设置插件属性时指定当前平台标识 22 | ``` 23 | apply plugin: 'galaxybruce-pioneer' 24 | 25 | galaxybrucepioneer { 26 | // 该标识用来匹配代码目录 27 | platformSourceDir = 'app2' 28 | ... 29 | } 30 | ``` 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /README_批量发布library到maven仓库.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | `批量发布library到maven仓库`支持根据配置把工程中多个module发布到maven仓库。 3 | 4 | ### 使用方式 5 | 6 | #### 1. 根目录下的build.gradle中添加如下代码 7 | ``` 8 | apply plugin: 'galaxybruce-pioneer' 9 | 10 | galaxybrucepioneer { 11 | // 配置需要发布到maven仓库的module信息 12 | moduleDataPath = "${project.rootDir.path}/modulemaven.json" 13 | 14 | // =================start================== 15 | // 公司maven私服 16 | mavenUrl = 'http://test.xxx.com/nexus/content/repositories/releases' 17 | // 公司maven私服SnapShot 18 | mavenUrlSnapShot = 'http://test.xxx.com/nexus/content/repositories/snapshots' 19 | // maven账号 20 | mavenAccount = 'deployment' 21 | // maven密码 22 | mavenPwd = '666666' 23 | // true: maven生成到指定目录:url = project.uri(project.rootProject.projectDir.absolutePath + '/repo-local') 24 | localMaven = false 25 | // =================end================== 26 | } 27 | 28 | buildscript { 29 | dependencies { 30 | classpath 'com.galaxybruce.android:pioneer-gradle-plugin:xxx' 31 | } 32 | } 33 | ``` 34 | 35 | #### 2. 配置发布到module信息 36 | modulemaven.json: 37 | ``` 38 | { 39 | "group": "com.galaxybruce", 40 | "version": "1.0.1", 41 | "modules": [ 42 | {"name": "testlibrary", "artifactId": "testlibrary", "version": ""} 43 | ] 44 | } 45 | ``` 46 | 每个library支持配置三个字段: 47 | * name: 必填项,必须是module名称 48 | * artifactId: 可选项,优先级: artifactId > project.name 49 | * version: 可选项,优先级: 这里的version > 上一层的version > android.defaultConfig.versionName 50 | 51 | 52 | #### 3. 上传maven命令: 53 | ``` 54 | ./gradlew uploadMaven 55 | ``` 56 | 57 | #### 4. 如果一个module上传为不同的平台发布,配置如下 58 | modulemaven.json内容: 59 | ``` 60 | { 61 | "group": "com.galaxybruce", 62 | "version": "1.0.1", 63 | "platform_modules": { 64 | "app1": [ 65 | {"name": "testlibrary"} 66 | ], 67 | "app2": [ 68 | {"name": "testlibrary"} 69 | ] 70 | } 71 | } 72 | ``` 73 | 74 | #### 5. 上传maven命令: 75 | ``` 76 | ./gradlew uploadMaven -PplatformSourceDir=app1 77 | ./gradlew uploadMaven -PplatformSourceDir=app2 78 | ``` 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'galaxybruce-pioneer' 3 | 4 | android { 5 | compileOptions { 6 | sourceCompatibility JavaVersion.VERSION_1_8 7 | targetCompatibility JavaVersion.VERSION_1_8 8 | } 9 | 10 | buildFeatures { 11 | dataBinding true 12 | } 13 | 14 | compileSdk 31 15 | defaultConfig { 16 | applicationId "com.galaxybruce.poinner" 17 | minSdkVersion 21 18 | targetSdkVersion 31 19 | versionCode 1 20 | versionName "1.0" 21 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 22 | } 23 | buildTypes { 24 | release { 25 | minifyEnabled false 26 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 27 | } 28 | } 29 | } 30 | 31 | dependencies { 32 | implementation fileTree(dir: 'libs', include: ['*.jar']) 33 | implementation 'androidx.appcompat:appcompat:1.0.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta7' 35 | implementation 'com.google.android.material:material:1.0.0' 36 | testImplementation 'junit:junit:4.12' 37 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 39 | 40 | implementation project(':testlibrary') 41 | } 42 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/galaxybruce/poinner/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.galaxybruce.poinner; 2 | 3 | import android.content.Context; 4 | import androidx.test.platform.app.InstrumentationRegistry; 5 | import androidx.test.ext.junit.runners.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.galaxybruce.poinner", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/app1/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/app1/java/com/galaxybruce/pionner/demo/AppActivity_1.java: -------------------------------------------------------------------------------- 1 | package com.galaxybruce.pionner.demo; 2 | 3 | import android.content.Intent; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | 8 | import com.galaxybruce.pionner.R; 9 | import com.galaxybruce.testlibrary.Lib1Activity_1; 10 | 11 | public class AppActivity_1 extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.app_layout_1); 17 | 18 | findViewById(R.id.btn_lib1).setOnClickListener(new View.OnClickListener() { 19 | @Override 20 | public void onClick(View v) { 21 | startActivity(new Intent(AppActivity_1.this, Lib1Activity_1.class)); 22 | } 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/app1/res/layout/app_layout_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 |