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

0.3.0: android.jar classpath seems to be missing #49

Closed
herriojr opened this issue Sep 28, 2022 · 2 comments
Closed

0.3.0: android.jar classpath seems to be missing #49

herriojr opened this issue Sep 28, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@herriojr
Copy link
Contributor

herriojr commented Sep 28, 2022

I don't know what changed exactly in 0.3.0, but if I don't explicitly add the android.jar classpath (and run the metalava command manually), I get a lot of issues in both the signature generation such as:

src/main/my/package/MyClass.java:5: info: Unresolved import: android.text.TextUtils [UnresolvedImport]

Unfortunately, this causes the signature to be generated improperly and breaks everything.

I've attempted reproducing this with one of the samples in this repository. I don't get the same exact error, however, I do get the following generation for the android-groovy if I use an Android class:

package me.tylerbwong.gradle.metalava.sample

import android.text.TextUtils
import java.io.IOException
import java.util.*

interface SamplePublicApi {
    val publicApiProperty: String
    fun publicApiFunction()
    @Throws(IOException::class)
    fun test(list: ArrayList<String>)
    fun test2(test: TextUtils)
}

generates:

// Signature format: 4.0
package me.tylerbwong.gradle.metalava.sample {

  public interface SamplePublicApi {
    method public String getPublicApiProperty();
    method public void publicApiFunction();
    method @kotlin.jvm.Throws(exceptionClasses=IOException::class) public void test(java.util.ArrayList<java.lang.String> list);
    method public void test2(error.NonExistentClass test);
    property public abstract String publicApiProperty;
  }

}

Edit: It appears the bootClassPath needs to be added to the compileClassPath.

@tylerbwong tylerbwong added the bug Something isn't working label Sep 28, 2022
herriojr added a commit to herriojr/metalava-gradle that referenced this issue Sep 28, 2022
herriojr added a commit to herriojr/metalava-gradle that referenced this issue Sep 28, 2022
@herriojr
Copy link
Contributor Author

@tylerbwong I created a patch for this that I've verified to work that just needs to be merged. I guess after a version bump will be required.

@tylerbwong
Copy link
Owner

Thanks so much for catching this! I'll release 0.3.1 shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants