Skip to content
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
Merged

Add kotlin_android_library macro #32

merged 3 commits into from
Sep 8, 2017

Conversation

fishy
Copy link
Contributor

@fishy 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
Copy link
Contributor

pcj commented Sep 7, 2017

Nice!

@pcj
Copy link
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
Copy link
Contributor Author

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
Copy link
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
Copy link
Contributor Author

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
Copy link
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
@fishy fishy deleted the android branch September 8, 2017 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants