forked from priyaaank/RobolectricSample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCONVERTING-EXISTING-APPS
63 lines (37 loc) · 1.98 KB
/
CONVERTING-EXISTING-APPS
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
ALTERING YOUR EXISTING APPLICATION -- WORK IN PROGRESS
Before you open IntelliJ:
- Add the Robolectric (droid-sugar) git submodule to your application. (You'll probably want to fork the droid-sugar
repository so you can make changes, and hopefully you'll contribute your improvements back!)
In the root of your application run:
git submodule add [email protected]:pivotal/droid-sugar.git
- Reorganize your project. From the root of your project:
mkdir -p code aidls/src
mv src gen code
- find all *.aidl under code and move under aidls/src directory. If you don't have any aidl's in your project,
you'll probably want to add a dummy text file in the aidls/src directory so that the directories are not auto
deleted by IntelliJ.
mkdir -p code/lib/main
- place your project's production jars in this directory (I.E. roboguice jar)
mkdir -p code/lib/test
- place your project's test jars in this directory (I.E. junit jar)
- add the following to the build.properties in the root of your project:
source.dir=code/src
test.dir=code/test
aidl.dir=aidls/src
tmp.dir=tmp
external.libs.dir=code/lib/main
- Open IntelliJ [this section is not correct/complete]
Go to Module Setup
Select Code module -> Dependencies -> Add -> Library -> Global Library... -> Android x.x
set the scope to: Complile
Select Code module -> Dependencies -> Add -> Library -> Module Library -> jar directory -> choose 'code/lib/test'
set the scope to: Test
Select (main project module) -> Android facet
Select (*) Generate Java files under other source root: [ .../code/gen ]
Select (main module) -> Dependencies
Add -> Module dependency -> Code
Add -> Module dependency -> Aidls
Create new module -> use existing iml with droid-sugar/droid-sugar.iml.
Select Code module -> Dependencies
Add -> Module dependency -> droid-sugar
Change scope from Compile to Test