New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add `kotlin_android_library` macro #32

Merged
merged 3 commits into from Sep 8, 2017

Conversation

Projects
None yet
2 participants
@fishy
Contributor

fishy commented Sep 7, 2017

The current kotlin_library macro has a problem with AAR libraries when generating the implicated name.jar file. This new kotlin_android_library rule fixed it.

The documentation is also updated.

https://github.com/fishy/notifbot/tree/kotlin is a working example.

@pcj

This comment has been minimized.

Contributor

pcj commented Sep 7, 2017

Nice!

@pcj

This comment has been minimized.

Contributor

pcj commented Sep 7, 2017

@fishy can you clarify how I satisfy the support library dependencies for notifbot? Trying to compile your app:

pcj:~/github/fishy/notifbot/android*kotlin$ bazel build :app 
ERROR: /Users/pcj/github/fishy/notifbot/android/BUILD:17:1: no such target '@androidsdk//com.android.support:appcompat-v7-25.3.1': target 'appcompat-v7-25.3.1' not declared in package 'com.android.support' (did you mean 'appcompat-v7-25.0.1'?) defined by /private/var/tmp/_bazel_pcj/0542ecb82494809edb66a176e8accee0/external/androidsdk/com.android.support/BUILD and referenced by '//:notifbot_aar'
ERROR: /Users/pcj/github/fishy/notifbot/android/BUILD:17:1: no such target '@androidsdk//com.android.support:cardview-v7-25.3.1': target 'cardview-v7-25.3.1' not declared in package 'com.android.support' (did you mean 'cardview-v7-25.0.1'?) defined by /private/var/tmp/_bazel_pcj/0542ecb82494809edb66a176e8accee0/external/androidsdk/com.android.support/BUILD and referenced by '//:notifbot_aar'
ERROR: /Users/pcj/github/fishy/notifbot/android/BUILD:17:1: no such target '@androidsdk//com.android.support:recyclerview-v7-25.3.1': target 'recyclerview-v7-25.3.1' not declared in package 'com.android.support' (did you mean 'recyclerview-v7-25.0.1'?) defined by /private/var/tmp/_bazel_pcj/0542ecb82494809edb66a176e8accee0/external/androidsdk/com.android.support/BUILD and referenced by '//:notifbot_aar'
ERROR: /Users/pcj/github/fishy/notifbot/android/BUILD:17:1: no such target '@androidsdk//com.android.support:appcompat-v7-25.3.1': target 'appcompat-v7-25.3.1' not declared in package 'com.android.support' (did you mean 'appcompat-v7-25.0.1'?) defined by /private/var/tmp/_bazel_pcj/0542ecb82494809edb66a176e8accee0/external/androidsdk/com.android.support/BUILD and referenced by '//:notifbot'
ERROR: /Users/pcj/github/fishy/notifbot/android/BUILD:17:1: no such target '@androidsdk//com.android.support:cardview-v7-25.3.1': target 'cardview-v7-25.3.1' not declared in package 'com.android.support' (did you mean 'cardview-v7-25.0.1'?) defined by /private/var/tmp/_bazel_pcj/0542ecb82494809edb66a176e8accee0/external/androidsdk/com.android.support/BUILD and referenced by '//:notifbot'
ERROR: /Users/pcj/github/fishy/notifbot/android/BUILD:17:1: no such target '@androidsdk//com.android.support:recyclerview-v7-25.3.1': target 'recyclerview-v7-25.3.1' not declared in package 'com.android.support' (did you mean 'recyclerview-v7-25.0.1'?) defined by /private/var/tmp/_bazel_pcj/0542ecb82494809edb66a176e8accee0/external/androidsdk/com.android.support/BUILD and referenced by '//:notifbot'
@fishy

This comment has been minimized.

Contributor

fishy commented Sep 7, 2017

You can change all "25.3.1" into "25.0.1" and that should work, too. It's not like I used any new feature in 25.3.1, I just tried to use the newest version available.

It's not very obvious to me which packages in Android SDK provided the version 25.3.1 of the support libraries. Probably "Android SDK Platform 25, rev3"? Try update your Android SDK packages :)

@pcj

This comment has been minimized.

Contributor

pcj commented Sep 7, 2017

OK thanks, I'll try that. Seems like there could be a bazel android repository rule that interacts with ANDROID_HOME/tools/bin/sdkmanager and gets things installed automatically (? @ahumesky)

@fishy

This comment has been minimized.

Contributor

fishy commented Sep 7, 2017

I did some test, the package is "extras;android;m2repository" with version number "47.0.0". Since you have 25.0.1, I guess you have that package, but it's not the newest version. Try update that package in your Android SDK :)

@pcj

This comment has been minimized.

Contributor

pcj commented Sep 8, 2017

Tested, looks good.

Thanks for this awesome contribution @fishy, this is a real leap forward in terms of making bazel enjoyable with android.

@pcj pcj merged commit ce2aaad into pubref:master Sep 8, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@fishy fishy deleted the fishy:android branch Sep 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment