Skip to content

Commit 45001ef

Browse files
committed
updated dependencies and added tests
1 parent 266adcb commit 45001ef

File tree

5 files changed

+29473
-2
lines changed

5 files changed

+29473
-2
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,10 @@ androidx-29:
8484
-super ${ANDROID_HOME}/platforms/android-29/android.jar -skip-declarations
8585
mv out/android.d.ts out/androidx-29.d.ts
8686

87+
test-compare-output:
88+
java -jar dts-generator/build/libs/dts-generator.jar \
89+
-input libs
90+
cmp out/android.d.ts test/expected-output/android.d.ts
91+
cmp out/android-declarations.d.ts test/expected-output/android-declarations.d.ts
92+
8793
androidx-all: androidx-17 androidx-23 androidx-26 androidx-28 androidx-29

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ java -jar build/libs/dts-generator.jar -input <jarFolder>
4646

4747
> Note: Check the [Makefile](Makefile) for sample usage
4848
49+
## Test
50+
51+
In order to test the tool there are some predefined androuidx packages. We are running the tool and comparing the output with the expected output commited in the repo.
52+
To run the test:
53+
54+
```shell
55+
make test-compare-output
56+
```
57+
58+
Then check whether the make command will return an error comparing the files.
59+
60+
> Note: If the libs folder content is changed, the expected output should also be changed
61+
4962
## Generate definitions for .aar
5063
```
5164
Open the .aar archive

dts-generator/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ allprojects {
2424
}
2525

2626
dependencies {
27-
implementation 'org.apache.bcel:bcel:6.4.1'
28-
implementation 'commons-io:commons-io:2.6'
27+
implementation 'org.apache.bcel:bcel:6.5.0'
28+
implementation 'commons-io:commons-io:2.8.0'
2929
implementation 'com.github.spotbugs:spotbugs:3.1.12'
3030

3131
// add your dependency here as the example bellow, make sure you are using testCompileOnly
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module native { export class Array<T> { constructor(); length: number; [index: number]: T; } }
2+
3+
import globalAndroid = android;
4+

0 commit comments

Comments
 (0)