ARSCLib icon indicating copy to clipboard operation
ARSCLib copied to clipboard

support for `publishToMavenLocal`

Open AbhiTheModder opened this issue 7 months ago • 6 comments

Just a proposal, this makes it easier to use in a project without building & including/updating jar file everytime, (for eg. adding as submodule and simply running ./gradlew publishToMavenLocal)

AbhiTheModder avatar Jun 07 '25 02:06 AbhiTheModder

@AbhiTheModder Sorry I don't know how I didn't see this PR for long. I have no much information about publish , normally I do publish releases manually (which is painful ) to maven repo. I would love if you explain me a bit more. Speaking of publish, do you have any idea to avoid using jar binaries on APKEditor ? I tried adding as sub-modules but not continent to manage from shell command.

REAndroid avatar Aug 17 '25 11:08 REAndroid

Speaking of publish, do you have any idea to avoid using jar binaries on APKEditor ? I tried adding as sub-modules but not continent to manage from shell command.

While using a submodule isn't strictly necessary (users could clone ARSCLib separately and publish it to their local Maven manually, which would also work after this idea gets accepted), adopting it as a submodule can streamline the process. There might be instances where we forget to clone ARSCLib and run publishToMavenLocal. Adding it as a submodule ensures that after cloning APKEditor we will also update and fetch submodules. Then, within the ARSCLib submodule directory, running ./gradlew publishToMavenLocal will publish the library locally to MavenLocal (storing libraries under $HOME/.m2). This only requires adding one extra dependency resolution repository before MavenCentral in the build script as MavenLocal and removing our manual loading implementation of libs. Afterward, it can be imported as a dependency through implementation,:

instead of implementation("io.github.reandroid:ARSCLib:+") we will do this instead for MavenLocal:

implementation("com.reandroid:ARSCLib:+")

eliminating the need to update a remote Maven repo (though optionally, this can still be done if you wish for people who like MavenCentral) or manually updating libraries.

Here's a small video:

https://github.com/user-attachments/assets/a169c5e1-a7d4-4a9e-b93f-fc372e76bb0b

AbhiTheModder avatar Aug 17 '25 13:08 AbhiTheModder

@AbhiTheModder Thank you! I learned something. As personal hack I place naughty dependencies under $HOME/.m2 but didn't know publishToMavenLocal does the trick.

We can't use implementation("com.reandroid:ARSCLib:+") on APKEditor bc we don't have valid repository.

I think it is complicated for regular users of APKEditor to clone ARSCLib separately.

REAndroid avatar Aug 17 '25 16:08 REAndroid

I think it is complicated for regular users of APKEditor to clone ARSCLib separately.

Agreed, that's why I suggested including it as a submodule and updating the build instructions in the README. Anyway, that's for APKEditor. What I'm proposing here is for ARSCLib is purely for my own (& others if they would prefer MavenLocal) convenience (so you can ignore it if it's not up to your liking<3 ) . This way, I could use the latest updates without relying on jars in my project. Currently, I have to keep this branch of mine updated with upstream just to use it :)

AbhiTheModder avatar Aug 18 '25 07:08 AbhiTheModder

I am checking https://central.sonatype.org/publish/publish-portal-snapshots/

Ouch, that's nice & good for anyone to try for latest changes, but this line there fears me:

Specifically, -SNAPSHOT releases are cleaned up after a period of time (currently 90 days)

AbhiTheModder avatar Aug 18 '25 07:08 AbhiTheModder