-
Notifications
You must be signed in to change notification settings - Fork 169
Exopackage Configuration Guide
Exopackage: A technique for fast, iterative Android development.
There are 4 steps to enable it:
1 . Follow step 6 of BUCK official Exopackage guide, but when it tells you to modify your BUCK file, just skip the modification.
2 . set OkBuck exopackage related configuration in your root build.gradle:
NOTE THAT below are example, do not copy these into your configuration! See more at below.
okbuck {
...
exopackage = [
app: true
]
appLibDependencies = [
'appProd': [
'buck-android-support',
'com.android.support:multidex',
'libraries/javalibrary:main',
'libraries/common:paidRelease',
],
'appDev': [
'buck-android-support',
'com.android.support:multidex',
'libraries/javalibrary:main',
'libraries/common:freeDebug',
],
'appDemo': [
'buck-android-support',
'com.android.support:multidex',
'libraries/javalibrary:main',
'libraries/common:paidRelease',
]
]
...
}
3 . Inside exopackage
map, just add a key-value pair, key is your application module name, and value is true
(of course true when you want enable exopackage)
4 . appLibDependencies
is the official guide modification, which should be determined by experiment.
The start value of appLibDependencies
could be 'buck-android-support'
, then run your ./buckw install
command, (e.g. ./buckw install -r app
).
If buck failed with error like:
/Users/piasy/src/OkBuck/app/src/main/java/com/github/piasy/okbuck/example/AppShell.java:27: error: package android.support.multidex does not exist
import android.support.multidex.MultiDex;
^
/Users/piasy/src/OkBuck/app/src/main/java/com/github/piasy/okbuck/example/AppShell.java:48: error: can't find symbol
MultiDex.install(this);
then you should add 'com.android.support:multidex'
into appLibDependencies
value list, and 'com.android.support:multidex'
is the module/jar/aar which the unfound symbol locates, and you can either set it as group name pair('com.android.support:multidex'
), or only name('multidex'
), and for local library module, it should be in the format of "${path}:${variant}"
, e.g. 'libraries/javalibrary:main'
and 'libraries/common:paidRelease'
.