OLD | NEW |
1 Adblock Plus Library for Android | 1 Adblock Plus Library for Android |
2 ======================== | 2 ======================== |
3 | 3 |
4 An Android library project that runs a proxy to block ads. | 4 An Android library project that runs a proxy to block ads. |
5 | 5 |
6 Updating the dependencies | 6 Updating the dependencies |
7 ------------------------- | 7 ------------------------- |
8 | 8 |
9 Adblock Plus Library for Android has dependencies that aren't in this repository
. | 9 Adblock Plus Library for Android has dependencies that aren't in this repository
. |
10 To update those, call: | 10 To update those, call: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 ### Building | 46 ### Building |
47 | 47 |
48 Set environment variable ANDROID_HOME to your Android SDK directory or pass it i
n command-line (below). | 48 Set environment variable ANDROID_HOME to your Android SDK directory or pass it i
n command-line (below). |
49 In the 'libadblockplus-android' directory run: | 49 In the 'libadblockplus-android' directory run: |
50 | 50 |
51 mvn clean install [-Dandroid.sdk.path=/some/where/sdk] | 51 mvn clean install [-Dandroid.sdk.path=/some/where/sdk] |
52 | 52 |
53 This will generate *.aar library artifact in the 'target' directory. | 53 This will generate *.aar library artifact in the 'target' directory. |
54 | 54 |
| 55 Building with Gradle/Android Studio |
| 56 ----------------------------------- |
| 57 |
| 58 ### Requirements |
| 59 |
| 60 * [The Android SDK](http://developer.android.com/sdk) |
| 61 * Android SDK Build tools 22.0.1 |
| 62 * [The Android NDK](https://developer.android.com/tools/sdk/ndk) |
| 63 |
| 64 Edit 'buildToolsVersion' in 'build.gradle' files if necessary. |
| 65 |
| 66 ### Building from command-line |
| 67 |
| 68 In the project root directory create the file _local.properties_ and set |
| 69 _sdk.dir_ and _ndk.dir_ to where you installed it, e.g.: |
| 70 |
| 71 sdk.dir = /some/where/sdk |
| 72 ndk.dir = /some/where/ndk |
| 73 |
| 74 In the project root directory run: |
| 75 |
| 76 ./gradlew assembleDebug |
| 77 |
| 78 This will generate *.aar library artifact in 'libadblockplus-android/build/outpu
ts/aar/' directory. |
| 79 |
55 ## Library tests | 80 ## Library tests |
56 | 81 |
57 ### Requirements | 82 ### Requirements |
58 | 83 |
59 Make sure _Library_ requirements are present. | 84 Make sure _Library_ requirements are present. |
60 | 85 |
61 ### Building | 86 ### Building with Ant |
62 | 87 |
63 Set ANDROID_HOME environment variable to your Android SDK directory. | 88 Set ANDROID_HOME environment variable to your Android SDK directory. |
64 | 89 |
65 In the 'libadblockplus-android-tests' run: | 90 In the 'libadblockplus-android-tests' run: |
66 | 91 |
67 ant instrument | 92 ant instrument |
68 | 93 |
69 ### Testing | 94 ### Testing with Ant |
70 | 95 |
71 1. Connect an Android device or start the Android Emulator. | 96 1. Connect an Android device or start the Android Emulator. |
72 2. In the 'libadblockplus-android-tests' directory run: | 97 2. In the 'libadblockplus-android-tests' directory run: |
73 | 98 |
74 ant instrument install test | 99 ant instrument install test |
75 | 100 |
76 to build instrumentation tests app and perform testing or run: | 101 to build instrumentation tests app and perform testing or run: |
77 | 102 |
78 ant test | 103 ant test |
79 | 104 |
80 to run installed instrumentation tests app. | 105 to run installed instrumentation tests app. |
81 | 106 |
82 To run specific **test** run: | 107 To run specific **test** run: |
83 | 108 |
84 ant testOnly -DtestClass=full.test.class.name | 109 ant testOnly -DtestClass=full.test.class.name |
85 | 110 |
86 For example: | 111 For example: |
87 | 112 |
88 ant testOnly -DtestClass=org.adblockplus.libadblockplus.tests.NotificationTe
st | 113 ant testOnly -DtestClass=org.adblockplus.libadblockplus.tests.NotificationTe
st |
89 | 114 |
90 To run specific **test method** run: | 115 To run specific **test method** run: |
91 | 116 |
92 ant testOnly -DtestClass=full.test.class.name#testMethod | 117 ant testOnly -DtestClass=full.test.class.name#testMethod |
93 | 118 |
94 For example: | 119 For example: |
95 | 120 |
96 ant testOnly -DtestClass=org.adblockplus.libadblockplus.tests.NotificationTe
st#testAddNotification | 121 ant testOnly -DtestClass=org.adblockplus.libadblockplus.tests.NotificationTe
st#testAddNotification |
| 122 |
| 123 ### Building with Gradle/Android Studio |
| 124 |
| 125 Make sure you've created _local.properties_ file to build the library (see above
). |
| 126 In the project root directory run: |
| 127 |
| 128 ./gradlew assembleDebugAndroidTest |
| 129 |
| 130 This will generate *.apk in 'libadblockplus-android-tests/build/outputs/apk/' di
rectory. |
| 131 |
| 132 ### Testing with Gradle/Android Studio |
| 133 |
| 134 You can select test class/method and click 'Run ..Test'. The library and test ap
p will be |
| 135 compiled, installed to emuator/device and launched automatically. |
OLD | NEW |