Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 46 additions & 10 deletions mode/tools/SDKUpdater/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,57 @@ dependencies {

implementationCopy group: "com.android.tools", name: "sdklib", version: "${toolsLibVersion}"
implementationCopy group: "com.android.tools", name: "repository", version: "${toolsLibVersion}"
implementationCopy group: "com.android.tools", name: "common", version: "${toolsLibVersion}"
}

// This task copies the gradle tooling jar into the mode folder
task copyToLib(type: Copy) {
from configurations.implementationCopy.files {
include '**/annotations-*'
include '**/common-*'
include '**/dvlib-*'
include '**/gson-*'
include '**/guava-*'
include '**/httpcore-*'
include '**/kotlin-stdlib-*'
include '**/layoutlib-api-*'
include '**/repository-*'
include '**/sdklib-*'
include '**/*.jar'
exclude '**/annotations-*'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just take care of wat you are removing from the final fat jar. And to test it you can try android-mode as external library in an android project.

Make sure that no dependency get excluded from the final fat jar.

Thanks !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure Aditya, I started by removing the jars, and whenever I got the class not found the issue, I added those specific class jars. I made sure both the Query and Download Swing Worker tasks went well. But I will do some more testing as you suggested to make sure no necessary dependency gets excluded.

Thanks for highlighting the importance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure Aditya, I started by removing the jars, and whenever I got the class not found the issue, I added those specific class jars. I made sure both the Query and Download Swing Worker tasks went well. But I will do some more testing as you suggested to make sure no necessary dependency gets excluded.

Thanks for highlighting the importance

hey @rupeshkumar22 any update on this ?

Thanks !

Copy link
Contributor Author

@rupeshkumar22 rupeshkumar22 Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ranaaditya
I am done with the testing and the updater faces no issues in fetching/installing the SDK data and reflecting back on the updater's UI. The included libraries in build.gradle are the only necessary and sufficient libraries to do the required operation of fetch or install.
Thanks

exclude '**/checker-qual-*.jar'
exclude '**/httpclient-*.jar'
exclude '**/layoutlib-api-*.jar'
exclude '**/commons-codec*.jar'
exclude '**/commons-logging*.jar'
exclude '**/dvlib-*.jar'
exclude '**/error_prone_annotations-*.jar'
exclude '**/failureaccess-*.jar'
exclude '**/FastInfoset-*.jar'
exclude '**/gson-*.jar'
exclude '**/httpmime-*.jar'
exclude '**/j2objc-*.jar'
exclude '**/javax.activation-*.jar'
exclude '**/jimfs-*.jar'
exclude '**/jna-*.jar'
exclude 'jsr305*jar'
exclude '**/kotlin-stdlib-c*.jar'
exclude '**/kotlin-stdlib-jdk7*.jar'
exclude '**/kotlin-stdlib-jdk8*.jar'
exclude '**/kxml2-*jar'
exclude '**/listenablefuture-*jar'
exclude '**/stax-*jar'
exclude '**/txw2*jar'

// uncommenting the following and commenting out the above statements work the same way
// better to mention both the included and excluded jars to keep a track

// include '**/common-*jar'
// include '**/commons-compress-*jar'
// include '**/guava-*jar'
// include '**/httpcore-*jar'
// include '**/istack-*jar'
// include '**/jakarta.activation-api-*jar'
// include '**/jakarta.xml.bind-api-*jar'
// include '**/jaxb-runtime-*jar'
// include '**/kotlin-stdlib-1*jar'
// include '**/shared-*jar'
// include '**/protos-*jar'
// include '**/protob*jar'
// include '**/sdklib-*jar'
// include '**/repository-*jar'


}
into "lib"
}
Expand Down
Loading