-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
79 lines (37 loc) · 2.43 KB
/
README
File metadata and controls
79 lines (37 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
WARNING: This sbt plugin hasn't been updated for a while. The Eclipse plugin (https://github.com/banshee/AndroidProguardScala) is much more current.
WHAT IS ProguardCache?
Normally when you're using scala on Android, you need to run Proguard to reduce the size of your binary. Dalvik currently has a limit
of 64k call sites (method definitions and method calls). The standard scala library blows that limit. So to use scala at all, you have
to run Proguard every time.
This library caches Proguard runs so you get a collection of scala libraries. It does that by:
* Using asm, detect all calls to the scala libraries by your code.
* Calculate a checksum of the list of calls to the scala library.
* Check to see if there's an existing cached copy of the scala library that matches that checksum.
* If so, use it!
* If not, build a new scala library, put it in the cache, and install it
In theory, this should substantially reduce the number of times you need to run Proguard while you're developing.
---
REQUIREMENTS
This version is an addon to the popular android-plugin library at https://github.com/jberkel/android-plugin. You'll need that first.
SETUP
---
1. Get the source (required)
Check out the repository to your local filesystem:
git clone git://github.com/banshee/ProguardCache.git
Right now, you need a local checkout for the plugin to work. (The JRuby setup needs full paths to
files it includes, so a jar doesn't work yet.)
---
2. Copy and modify the configuration files
The doc directory has two files you need to copy to your project:
build.sbt : a sample build.sbt
project/project/ProguardCache.scala : the file to include the ProguardCache plugin.
(Notice that you want to put ProguardCache.scala in project/project - two project directories.)
Both of these files need to be edited to match your configuration. The comments in those
files tell you what should be changed.
---
3. Build your project
sbt compile proguard-cache-build android:package-debug
The plugin provides a new sbt command: proguard-cache-build. It detects whether or not your changes require building a new scala library jarfile.
If it doesn't detect changes, it won't run proguard - a big time savings.
The downside right now is that you don't want to use both this plugin and the normal android-plugin's proguard run. When and if you want
to do a final proguard run across all your code, you'll need to take out this plugin from build.sbt.