android-project-combine
android-project-combine copied to clipboard
combine multiple android gradle projects on one Android Studio window.
Android Project Combine
Combine multiple android projects on one Android Studio window safely and easily, which just mock a combined project contains multiple projects, so you just open combine project on Android Studio to maintain those projects.
KICK OFF
This demonstrate we using configures on repos.templete.conf(combine FileDownloader project with filedownloader-okhttp3-connection project):
Following is the demonstrate to maintain filedownloader-okhttp3-connection
on android-project-combine:
P.S. If above videos can't play,you can click video1、video2 to download they manually.
WHAT ABOUT THIS?
This is very useful when you developing several projects but they need to communicate each other(such as Atlas project)
- Just a developing env wrapper, it can't modify projects, safe to use.
- Different Android projects develop together at the one Android Studio window.
- Find References and Jump into source code rather than .class file on jar package.
- Jump out of the each projects compile system and using the official compile system.
- Very light, very fast for each time you want to refresh combine project.
HOW TO USE?
Step 1. Clone This Repo
First of all, you need clone this repo, and enter the repo folder which is your work place now, simply way is:
git clone [email protected]:Jacksgong/android-project-combine.git && cd android-project-combine
So following steps are working on the repo folder.
Step 2. Create repos.conf
File
P.S. You can refer to
./repos.templete.conf
You need create repos.conf
file on project root directory, and declare which repo you want to combine on it(one line one repo address).
# import FileDownloader porject
[email protected]:lingochamp/FileDownloader.git
# declare the FileDownloader exposed arr with groupId:artifactId
- exposed: com.liulishuo.filedownloader:library
# declare ignore the module with its folder name 'demo'
- ignore-module: demo
# declare ignore the module with its folder name 'demo2'
- ignore-module: demo2
# import filedownloader okhttp3 connection project
[email protected]:Jacksgong/filedownloader-okhttp3-connection.git
# import Demo project on ~/Downloads/Demo folder
~/Downloads/Demo
As you can see above, we can recognize repos address and local absolute path.
Step 3. Refresh env
Execute ./refresh.sh
to refresh env
Step 3. Open on the Android Studio
Open android-project-combine on the Android Studio.
STRUCTURE OF COMBINE PROJECT
.
├── .combine // all combine python script folder
│ ├── combine.py // scan projects and generated env
│ ├── res_generator.py // scan projects resources and generated mock resources module
│ ├── res_utils.py // utils for 'res_generator.py'
│ └── utils.py // utils for 'combine.py'
├── gradle // gradle script folder
│ ├── repositories-default.gradle // the default repositories configuration
│ ├── combine-common.gradle // common gradle for combine project
│ └── combine-res-common.gradle // common gradle for mock resources modules
├── .gitignore // we ignored 'repos.conf', 'repos/', 'conf/', 'combine/', 'combine-settings.gradle'
├── clean.sh // you can use this shell script to clean combine env safely
├── combine // [generated by refresh.sh] mock project which contain all staff of your projects
│ └── dev // [generated by refresh.sh] mock combine project which name is 'dev'
│ ├── AndroidManifest.xml
│ ├── build.gradle
│ ├── [mock-res-module1] // mock resources module1
│ ├── ... // mock resources module...
│ └── [mock-res-modulen] // mock resources modulen
├── combine-settings.gradle // [generated by refresh.sh] declared contain modules, this is include by settings.gradle
├── conf // [generated by refresh.sh] declared the characteristic of combine projects
│ └── dev-combine.gradle // [generated by refresh.sh] declared the characteristic of combine project, you can edit it to fix some uncovered error
├── local // local module folder, you can do some customzie on this local module
│ ├── AndroidManifest.xml
│ ├── build.gradle
│ ├── local-build.gradle // [added by you] you can declare some persist the dependencies on here
│ └── .gitignore // we ignored 'src/', 'res/', 'libs/' on local module, so you can do anything you like clearly
├── refresh.sh // you can use this shell script to clean and update combine env safely
├── repos // store all projects you declared on 'repos.conf' , we don't change anything on this folder and ignored this folder on '.gitignore', so please feel free to maintain your projects on it
│ ├── [your-project-1] // your project 1
│ | ├── [project-1-module-1]
│ | └── [project-1-module-2]
│ ├── [your-project-2] // your project 2
│ ├── ... // your project ...
│ └── [your-project-n] // your project n
├── repos.conf // [added by you] declared which projects you want to combine with together
├── repos.templete.conf // [demo conf]the templete of 'repos.conf'
├── dependencies-version.conf // [added by you] declared which dependencies version you want to force replace
├── dependencies-version.templete.conf// [demo conf] templete of 'dependencies-version.conf'
├── repositories.gradle // [added by you] you can create 'repositories.gradle' file to declare repositories
└── settings.gradle // settings.gradle which include 'local' module and 'combine-settings.gradle'
TODO LIST
- [x] Support aidl
- [x] Support buildConfigField on gradle
- [x] Support
-exposed:
to exposedgroud_id
andartifact_id
- [x] Support mipmap
- [x] Support
-ignore-module: [folder name]
- [x] Support recognize Absolute Local Path on 'repos.conf'
- [x] Support dependencies version with 'ext' params
- [x] Support force replace some dependencies library version automatically
LICENSE
Copyright (C) 2017 Jacksgong(blog.dreamtobe.cn)
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.