If you have Android Studio, the android gradle plugin and an Android application installed, you can find the source code for the gradle plugin on your own development machine.
- cd to your home directory
- cd in .gradle / caches / modules-2 / files-2.1 / com.android.tools.build / gradle -core /
- use a deep search tool (for example, find) to search for a file with a name like gradle -core-2.3.1-sources.jar '(Note: in this example, "2.3.1" has only one possibility. You may have a different version. On There may be several versions of your computer.)
In other words, the downloaded module module jar files are stored in gradle along a path that looks something like this:
~ / .gradle / caches / modules-2 / files-2.1 / com.android.tools.build / gradle -core / 2.3.1 / 59c72f62795f6ce6dd95c0b2e91c16dc16a1c8c7 / gradle -core-2.3.1-sources. jar
(On your computer, the hash and version in this way may differ.)
You can copy this jar file to another place and then unzip it to view the actual source files for the android gradle plugin:
./com/Android/assemblies/gradle/api/AndroidArtifactVariant.java. / com / android / build / gradle / api / AndroidSourceDirectorySet.java. / com / android / build / gradle / api / AndroidSourceFile.java. / com / android / build / gradle / api / AndroidSourceSet.java. / com / android / build / gradle / api / ApkOutputFile.java
./com/android/build/gradle/api/ApkVariant.java. / com / android / build / gradle / api / ApkVariantOutput.java. / com / android / build / gradle / api / ApplicationVariant.java. / com / android / build / gradle / api / AtomVariant.java. / com / android / build / gradle / api / AtomVariantOutput.java. / com / android / build / gradle / api / BaseVariant.java. / com / android / build / gradle / api / BaseVariantOutput.java
,,.
source share