├── .gitignore ├── .idea ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── compiler.xml ├── dictionaries │ └── alanchen.xml ├── encodings.xml ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml ├── jarRepositories.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── me │ │ └── yifeiyuan │ │ └── headfirstgradleplugin │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── me │ │ │ └── yifeiyuan │ │ │ └── headfirstgradleplugin │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── me │ └── yifeiyuan │ └── headfirstgradleplugin │ └── ExampleUnitTest.kt ├── build.gradle ├── buildSrc ├── build.gradle ├── build │ ├── classes │ │ └── groovy │ │ │ └── main │ │ │ └── me │ │ │ └── yifeiyuan │ │ │ └── buildsrctest │ │ │ ├── BuildSrcPlugin$_apply_closure1$_closure2.class │ │ │ ├── BuildSrcPlugin$_apply_closure1.class │ │ │ ├── BuildSrcPlugin.class │ │ │ ├── DirectPlugin$_apply_closure1$_closure2.class │ │ │ ├── DirectPlugin$_apply_closure1.class │ │ │ └── DirectPlugin.class │ ├── libs │ │ └── buildSrc.jar │ ├── resources │ │ └── main │ │ │ └── META-INF │ │ │ └── gradle-plugins │ │ │ └── me.yifeiyuan.buildsrctest.properties │ ├── source-roots │ │ └── buildSrc │ │ │ └── source-roots.txt │ └── tmp │ │ └── jar │ │ └── MANIFEST.MF └── src │ └── main │ ├── groovy │ └── me.yifeiyuan.buildsrctest │ │ ├── BuildSrcPlugin.groovy │ │ └── DirectPlugin.groovy │ └── resources │ └── META-INF │ └── gradle-plugins │ └── me.yifeiyuan.buildsrctest.properties ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── plugin-kotlin ├── .gitignore ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── me │ └── yifeiyuan │ └── ktplugin │ └── KotlinPlugin.kt ├── repos └── me │ └── yifeiyuan │ ├── my-library │ ├── 1.0.0 │ │ ├── my-library-1.0.0.jar │ │ ├── my-library-1.0.0.jar.md5 │ │ ├── my-library-1.0.0.jar.sha1 │ │ ├── my-library-1.0.0.pom │ │ ├── my-library-1.0.0.pom.md5 │ │ └── my-library-1.0.0.pom.sha1 │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ └── maven-metadata.xml.sha1 │ └── standalone-plugin │ ├── 1.0.1 │ ├── standalone-plugin-1.0.1.jar │ ├── standalone-plugin-1.0.1.jar.md5 │ ├── standalone-plugin-1.0.1.jar.sha1 │ ├── standalone-plugin-1.0.1.pom │ ├── standalone-plugin-1.0.1.pom.md5 │ └── standalone-plugin-1.0.1.pom.sha1 │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ └── maven-metadata.xml.sha1 ├── settings.gradle └── standalone-plugin ├── build.gradle ├── build ├── classes │ └── groovy │ │ └── main │ │ └── me │ │ └── yifeiyuan │ │ └── standalone │ │ └── plugin │ │ ├── StandalonePlugin$_apply_closure1$_closure2.class │ │ ├── StandalonePlugin$_apply_closure1.class │ │ ├── StandalonePlugin.class │ │ ├── StandalonePlugin2$_apply_closure1$_closure2.class │ │ ├── StandalonePlugin2$_apply_closure1.class │ │ └── StandalonePlugin2.class ├── libs │ └── standalone-plugin.jar ├── publications │ └── mavenJava │ │ └── pom-default.xml ├── resources │ └── main │ │ └── META-INF │ │ └── gradle-plugins │ │ ├── me.yifeiyuan.myplugin.properties │ │ └── me.yifeiyuan.myplugin2.properties └── tmp │ ├── jar │ └── MANIFEST.MF │ └── publishMavenJavaPublicationToMavenRepository │ └── me │ └── yifeiyuan │ └── standalone-plugin │ ├── maven-metadata-remote.xml │ └── resolver-status.properties └── src └── main ├── groovy └── me │ └── yifeiyuan │ └── standalone │ └── plugin │ ├── StandalonePlugin.groovy │ └── StandalonePlugin2.groovy └── resources └── META-INF └── gradle-plugins ├── me.yifeiyuan.myplugin.properties └── me.yifeiyuan.myplugin2.properties /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | xmlns:android 17 | 18 | ^$ 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | xmlns:.* 28 | 29 | ^$ 30 | 31 | 32 | BY_NAME 33 | 34 |
35 |
36 | 37 | 38 | 39 | .*:id 40 | 41 | http://schemas.android.com/apk/res/android 42 | 43 | 44 | 45 |
46 |
47 | 48 | 49 | 50 | .*:name 51 | 52 | http://schemas.android.com/apk/res/android 53 | 54 | 55 | 56 |
57 |
58 | 59 | 60 | 61 | name 62 | 63 | ^$ 64 | 65 | 66 | 67 |
68 |
69 | 70 | 71 | 72 | style 73 | 74 | ^$ 75 | 76 | 77 | 78 |
79 |
80 | 81 | 82 | 83 | .* 84 | 85 | ^$ 86 | 87 | 88 | BY_NAME 89 | 90 |
91 |
92 | 93 | 94 | 95 | .* 96 | 97 | http://schemas.android.com/apk/res/android 98 | 99 | 100 | ANDROID_ATTRIBUTE_ORDER 101 | 102 |
103 |
104 | 105 | 106 | 107 | .* 108 | 109 | .* 110 | 111 | 112 | BY_NAME 113 | 114 |
115 |
116 |
117 |
118 | 119 | 121 |
122 |
-------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/dictionaries/alanchen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 23 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 45 | 46 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | Abstraction issuesJava 108 | 109 | 110 | Android 111 | 112 | 113 | Android > Lint > Correctness 114 | 115 | 116 | Android > Lint > Correctness > Messages 117 | 118 | 119 | Android > Lint > Performance 120 | 121 | 122 | Android > Lint > Security 123 | 124 | 125 | Android > Lint > Usability 126 | 127 | 128 | Assignment issuesJava 129 | 130 | 131 | Bitwise operation issuesJava 132 | 133 | 134 | Class metricsJava 135 | 136 | 137 | Class structureJava 138 | 139 | 140 | Cloning issuesJava 141 | 142 | 143 | Code maturity issuesJava 144 | 145 | 146 | Code style issuesJava 147 | 148 | 149 | Compiler issuesJava 150 | 151 | 152 | Concurrency annotation issuesJava 153 | 154 | 155 | Control flow issuesJava 156 | 157 | 158 | Data flow issuesJava 159 | 160 | 161 | Declaration redundancyJava 162 | 163 | 164 | Dependency issuesJava 165 | 166 | 167 | Encapsulation issuesJava 168 | 169 | 170 | Error handlingJava 171 | 172 | 173 | Finalization issuesJava 174 | 175 | 176 | GPath inspectionsGroovy 177 | 178 | 179 | General 180 | 181 | 182 | GeneralJava 183 | 184 | 185 | Google Cloud Endpoints 186 | 187 | 188 | Groovy 189 | 190 | 191 | ImportsJava 192 | 193 | 194 | Inheritance issuesJava 195 | 196 | 197 | Initialization issuesJava 198 | 199 | 200 | Internationalization issuesJava 201 | 202 | 203 | J2ME issuesJava 204 | 205 | 206 | JUnit issuesJava 207 | 208 | 209 | Java 210 | 211 | 212 | Java language level issuesJava 213 | 214 | 215 | Java language level migration aidsJava 216 | 217 | 218 | JavaBeans issuesJava 219 | 220 | 221 | Javadoc issuesJava 222 | 223 | 224 | Language Injection 225 | 226 | 227 | Logging issuesJava 228 | 229 | 230 | Memory issuesJava 231 | 232 | 233 | Method metricsJava 234 | 235 | 236 | Modularization issuesJava 237 | 238 | 239 | Naming ConventionsGroovy 240 | 241 | 242 | Naming conventionsJava 243 | 244 | 245 | Numeric issuesJava 246 | 247 | 248 | Packaging issuesJava 249 | 250 | 251 | Performance issuesJava 252 | 253 | 254 | Portability issuesJava 255 | 256 | 257 | Probable bugsGroovy 258 | 259 | 260 | Probable bugsJava 261 | 262 | 263 | Properties Files 264 | 265 | 266 | Properties FilesJava 267 | 268 | 269 | Resource management issuesJava 270 | 271 | 272 | Security issuesJava 273 | 274 | 275 | Serialization issuesJava 276 | 277 | 278 | StyleGroovy 279 | 280 | 281 | TestNGJava 282 | 283 | 284 | Threading issuesGroovy 285 | 286 | 287 | Threading issuesJava 288 | 289 | 290 | Verbose or redundant code constructsJava 291 | 292 | 293 | Visibility issuesJava 294 | 295 | 296 | toString() issuesJava 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 308 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 深入浅出 Gradle Plugin 2 | 3 | 4 | 1. buildSrc 5 | 2. 独立工程 6 | 7 | ## 简单的插件例子 8 | 9 | ```groovy 10 | class GreetingPluginExtension { 11 | 12 | String message = 'Hello from GreetingPlugin extension' 13 | 14 | String greeter = "Gradle" 15 | } 16 | 17 | class GreetingPlugin implements Plugin { 18 | 19 | @Override 20 | void apply(Project target) { 21 | 22 | def extension = target.extensions.create('greeting', GreetingPluginExtension) 23 | 24 | target.task("hello") { 25 | doLast { 26 | println "${extension.message} from ${extension.greeter}" 27 | } 28 | } 29 | } 30 | } 31 | 32 | apply plugin: GreetingPlugin 33 | // ./gradlew -q hello 34 | 35 | greeting { 36 | message = "Hi," 37 | greeter = "程序亦非猿" 38 | } 39 | ``` 40 | 41 | 执行`./gradlew -q hello` 就可以看到输出`Hi, from 程序亦非猿`。 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | import me.yifeiyuan.buildsrctest.DirectPlugin 2 | 3 | apply plugin: 'com.android.application' 4 | 5 | apply plugin: 'kotlin-android' 6 | 7 | apply plugin: 'kotlin-android-extensions' 8 | 9 | apply plugin: 'me.yifeiyuan.buildsrctest' //通过 pluginid 引用 10 | apply plugin: DirectPlugin //通过类名引用 11 | 12 | //apply plugin: 'me.yifeiyuan.myplugin' 13 | //apply plugin: 'me.yifeiyuan.myplugin2' 14 | 15 | //apply plugin: 'me.yifeiyuan.ktplugin' //有问题 找不到 16 | 17 | android { 18 | compileSdkVersion 29 19 | defaultConfig { 20 | applicationId "me.yifeiyuan.headfirstgradleplugin" 21 | minSdkVersion 21 22 | targetSdkVersion 29 23 | versionCode 1 24 | versionName "1.0" 25 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 26 | } 27 | buildTypes { 28 | release { 29 | minifyEnabled false 30 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 31 | } 32 | } 33 | } 34 | 35 | dependencies { 36 | implementation fileTree(dir: 'libs', include: ['*.jar']) 37 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 38 | implementation 'androidx.appcompat:appcompat:1.1.0' 39 | implementation 'androidx.core:core-ktx:1.1.0' 40 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 41 | testImplementation 'junit:junit:4.12' 42 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 43 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 44 | // implementation project(path: ':standalone-plugin') 45 | } 46 | 47 | 48 | class GreetingPluginExtension { 49 | 50 | String message = 'Hello from GreetingPlugin extension' 51 | 52 | String greeter = "Gradle" 53 | } 54 | 55 | class GreetingPlugin implements Plugin { 56 | 57 | @Override 58 | void apply(Project target) { 59 | 60 | def extension = target.extensions.create('greeting', GreetingPluginExtension) 61 | 62 | target.task("hello") { 63 | doLast { 64 | println "${extension.message} from ${extension.greeter}" 65 | } 66 | } 67 | } 68 | } 69 | 70 | apply plugin: GreetingPlugin 71 | // ./gradlew -q hello 72 | 73 | greeting { 74 | message = "Hi," 75 | greeter = "程序亦非猿" 76 | } 77 | 78 | class GreetingToFileTask extends DefaultTask { 79 | 80 | def destination 81 | 82 | @OutputFile 83 | File getDestination() { 84 | project.file(destination) 85 | } 86 | 87 | @TaskAction 88 | def greet() { 89 | def file = getDestination() 90 | file.parentFile.mkdirs() 91 | file.write 'Hello!111' 92 | } 93 | } 94 | 95 | task greet(type: GreetingToFileTask) { 96 | destination = { project.greetingFile } 97 | } 98 | 99 | task sayGreeting(dependsOn: greet) { 100 | doLast { 101 | println file(greetingFile).text 102 | } 103 | } 104 | 105 | ext.greetingFile = "$buildDir/hello.txt" -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/me/yifeiyuan/headfirstgradleplugin/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.headfirstgradleplugin 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("me.yifeiyuan.headfirstgradleplugin", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/me/yifeiyuan/headfirstgradleplugin/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.headfirstgradleplugin 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | 6 | class MainActivity : AppCompatActivity() { 7 | 8 | override fun onCreate(savedInstanceState: Bundle?) { 9 | super.onCreate(savedInstanceState) 10 | setContentView(R.layout.activity_main) 11 | 12 | "a".let { } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HeadFirstGradlePlugin 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/me/yifeiyuan/headfirstgradleplugin/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.headfirstgradleplugin 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.61' 5 | repositories { 6 | google() 7 | jcenter() 8 | mavenLocal() 9 | maven { 10 | url = 'repos' 11 | } 12 | } 13 | dependencies { 14 | classpath 'com.android.tools.build:gradle:3.5.2' 15 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 16 | // NOTE: Do not place your application dependencies here; they belong 17 | // in the individual module build.gradle files 18 | classpath 'me.yifeiyuan:standalone-plugin:1.0.1' 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | google() 25 | jcenter() 26 | 27 | } 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /buildSrc/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | 3 | dependencies { 4 | implementation gradleApi() 5 | implementation localGroovy() 6 | } -------------------------------------------------------------------------------- /buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/BuildSrcPlugin$_apply_closure1$_closure2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/BuildSrcPlugin$_apply_closure1$_closure2.class -------------------------------------------------------------------------------- /buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/BuildSrcPlugin$_apply_closure1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/BuildSrcPlugin$_apply_closure1.class -------------------------------------------------------------------------------- /buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/BuildSrcPlugin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/BuildSrcPlugin.class -------------------------------------------------------------------------------- /buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/DirectPlugin$_apply_closure1$_closure2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/DirectPlugin$_apply_closure1$_closure2.class -------------------------------------------------------------------------------- /buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/DirectPlugin$_apply_closure1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/DirectPlugin$_apply_closure1.class -------------------------------------------------------------------------------- /buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/DirectPlugin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/classes/groovy/main/me/yifeiyuan/buildsrctest/DirectPlugin.class -------------------------------------------------------------------------------- /buildSrc/build/libs/buildSrc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/buildSrc/build/libs/buildSrc.jar -------------------------------------------------------------------------------- /buildSrc/build/resources/main/META-INF/gradle-plugins/me.yifeiyuan.buildsrctest.properties: -------------------------------------------------------------------------------- 1 | implementation-class = me.yifeiyuan.buildsrctest.BuildSrcPlugin -------------------------------------------------------------------------------- /buildSrc/build/source-roots/buildSrc/source-roots.txt: -------------------------------------------------------------------------------- 1 | src/main/resources 2 | src/main/java 3 | src/main/groovy 4 | src/test/resources 5 | src/test/java 6 | src/test/groovy 7 | -------------------------------------------------------------------------------- /buildSrc/build/tmp/jar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /buildSrc/src/main/groovy/me.yifeiyuan.buildsrctest/BuildSrcPlugin.groovy: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.buildsrctest 2 | import org.gradle.api.Plugin 3 | import org.gradle.api.Project 4 | 5 | class BuildSrcPlugin implements Plugin { 6 | 7 | @Override 8 | void apply(Project project) { 9 | project.task("hiBuildSrc") { 10 | doLast { 11 | println("Hi from buildSrc project") 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /buildSrc/src/main/groovy/me.yifeiyuan.buildsrctest/DirectPlugin.groovy: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.buildsrctest 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | 6 | class DirectPlugin implements Plugin { 7 | 8 | @Override 9 | void apply(Project project) { 10 | 11 | project.task("DirectPlugin") { 12 | 13 | doLast { 14 | println("buildSrc - DirectPlugin") 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /buildSrc/src/main/resources/META-INF/gradle-plugins/me.yifeiyuan.buildsrctest.properties: -------------------------------------------------------------------------------- 1 | implementation-class = me.yifeiyuan.buildsrctest.BuildSrcPlugin -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 16 11:04:09 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /plugin-kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /plugin-kotlin/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `java-gradle-plugin` 3 | // kotlin("android") 4 | // `kotlin-dsl` 5 | } 6 | 7 | dependencies { 8 | implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61") 9 | } 10 | 11 | gradlePlugin { 12 | plugins { 13 | create("ktPlugin") { 14 | id = "me.yifeiyuan.ktPlugin" 15 | implementationClass = "me.yifeiyuan.ktplugin.KotlinPlugin" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /plugin-kotlin/src/main/kotlin/me/yifeiyuan/ktplugin/KotlinPlugin.kt: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.ktplugin 2 | 3 | import org.gradle.api.Project 4 | 5 | open class KotlinPlugin : org.gradle.api.Plugin { 6 | override fun apply(target: Project) { 7 | 8 | target.task("ktplugin"){ 9 | doLast { 10 | println("hi ktplugin") 11 | } 12 | } 13 | } 14 | 15 | 16 | } -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.jar -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.jar.md5: -------------------------------------------------------------------------------- 1 | 12afabee1e5a7b8f7cefa740010792ff -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.jar.sha1: -------------------------------------------------------------------------------- 1 | cea03129eaacea7f0113e7cf87e8f29c4ecafd48 -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | me.yifeiyuan 6 | my-library 7 | 1.0.0 8 | My Library 9 | A concise description of my library 10 | http://www.example.com/library 11 | 12 | 13 | The Apache License, Version 2.0 14 | http://www.apache.org/licenses/LICENSE-2.0.txt 15 | 16 | 17 | 18 | 19 | johnd 20 | John Doe 21 | john.doe@example.com 22 | 23 | 24 | 25 | scm:git:git://example.com/my-library.git 26 | scm:git:ssh://example.com/my-library.git 27 | http://example.com/my-library/ 28 | 29 | 30 | anotherValue 31 | value 32 | 33 | 34 | -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.pom.md5: -------------------------------------------------------------------------------- 1 | a327fea4e45a6a047b7354bfb8594ae7 -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/1.0.0/my-library-1.0.0.pom.sha1: -------------------------------------------------------------------------------- 1 | 921243b7bb9105f790529c9fc1b2e45295ba8a03 -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | me.yifeiyuan 4 | my-library 5 | 6 | 1.0.0 7 | 8 | 1.0.0 9 | 10 | 20191216091404 11 | 12 | 13 | -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/maven-metadata.xml.md5: -------------------------------------------------------------------------------- 1 | a15469cf7728dbc71d9c50e680e26d7b -------------------------------------------------------------------------------- /repos/me/yifeiyuan/my-library/maven-metadata.xml.sha1: -------------------------------------------------------------------------------- 1 | 2e495d764983431d3b3b1ef97691959d94016ae1 -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.jar -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.jar.md5: -------------------------------------------------------------------------------- 1 | 56b61b486798dd1264358842f468d268 -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.jar.sha1: -------------------------------------------------------------------------------- 1 | a7b0d201f491d5506ac93a57e1aea1324dbb2f6d -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | me.yifeiyuan 6 | standalone-plugin 7 | 1.0.1 8 | 9 | -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.pom.md5: -------------------------------------------------------------------------------- 1 | e31471e164267e0d6a8f88ed204479bc -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/1.0.1/standalone-plugin-1.0.1.pom.sha1: -------------------------------------------------------------------------------- 1 | bb982b271d6bacb8562be8e41226d4836e4d089c -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | me.yifeiyuan 4 | standalone-plugin 5 | 6 | 1.0.1 7 | 8 | 1.0.1 9 | 10 | 20191216115442 11 | 12 | 13 | -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/maven-metadata.xml.md5: -------------------------------------------------------------------------------- 1 | 48b530db68605f704cdcaf0e7b872c6c -------------------------------------------------------------------------------- /repos/me/yifeiyuan/standalone-plugin/maven-metadata.xml.sha1: -------------------------------------------------------------------------------- 1 | ea1028aa932e55e26eb0dd6d842f8354896654bd -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | //include ':plugin-kotlin' 2 | include ':app', ':standalone-plugin' 3 | rootProject.name='HeadFirstGradlePlugin' 4 | -------------------------------------------------------------------------------- /standalone-plugin/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | apply plugin: 'maven-publish' 3 | 4 | 5 | dependencies { 6 | implementation gradleApi() 7 | implementation localGroovy() 8 | } 9 | 10 | publishing { 11 | 12 | // version = '1.0.0' 13 | // group = 'me.yifeiyuan' 14 | 15 | publications { 16 | 17 | mavenJava(MavenPublication) { 18 | artifactId = 'standalone-plugin' 19 | from components.java 20 | version = '1.0.1' 21 | group = 'me.yifeiyuan' 22 | 23 | // versionMapping { 24 | // usage('java-api') { 25 | // fromResolutionOf('runtimeClasspath') 26 | // } 27 | // usage('java-runtime') { 28 | // fromResolutionResult() 29 | // } 30 | // } 31 | // pom { 32 | // name = 'My Library' 33 | // description = 'A concise description of my library' 34 | // url = 'http://www.example.com/library' 35 | // properties = [ 36 | // myProp : "value", 37 | // "prop.with.dots": "anotherValue" 38 | // ] 39 | // licenses { 40 | // license { 41 | // name = 'The Apache License, Version 2.0' 42 | // url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' 43 | // } 44 | // } 45 | // developers { 46 | // developer { 47 | // id = 'johnd' 48 | // name = 'John Doe' 49 | // email = 'john.doe@example.com' 50 | // } 51 | // } 52 | // scm { 53 | // connection = 'scm:git:git://example.com/my-library.git' 54 | // developerConnection = 'scm:git:ssh://example.com/my-library.git' 55 | // url = 'http://example.com/my-library/' 56 | // } 57 | // } 58 | } 59 | } 60 | 61 | repositories { 62 | maven { 63 | // change to point to your repo, e.g. http://my.org/repo 64 | // url = "repos" 65 | // url = "$buildDir/repos" 66 | url = "$rootProject.projectDir/repos" 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin$_apply_closure1$_closure2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin$_apply_closure1$_closure2.class -------------------------------------------------------------------------------- /standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin$_apply_closure1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin$_apply_closure1.class -------------------------------------------------------------------------------- /standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin.class -------------------------------------------------------------------------------- /standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin2$_apply_closure1$_closure2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin2$_apply_closure1$_closure2.class -------------------------------------------------------------------------------- /standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin2$_apply_closure1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin2$_apply_closure1.class -------------------------------------------------------------------------------- /standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/classes/groovy/main/me/yifeiyuan/standalone/plugin/StandalonePlugin2.class -------------------------------------------------------------------------------- /standalone-plugin/build/libs/standalone-plugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeadFirstAndroid/HeadFirstGradlePlugin/c3311540c48cf56d6a32d32277c48b1e4d3b11e7/standalone-plugin/build/libs/standalone-plugin.jar -------------------------------------------------------------------------------- /standalone-plugin/build/publications/mavenJava/pom-default.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | me.yifeiyuan 6 | standalone-plugin 7 | 1.0.1 8 | 9 | -------------------------------------------------------------------------------- /standalone-plugin/build/resources/main/META-INF/gradle-plugins/me.yifeiyuan.myplugin.properties: -------------------------------------------------------------------------------- 1 | implementation-class = me.yifeiyuan.standalone.plugin.StandalonePlugin -------------------------------------------------------------------------------- /standalone-plugin/build/resources/main/META-INF/gradle-plugins/me.yifeiyuan.myplugin2.properties: -------------------------------------------------------------------------------- 1 | implementation-class = me.yifeiyuan.standalone.plugin.StandalonePlugin2 -------------------------------------------------------------------------------- /standalone-plugin/build/tmp/jar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /standalone-plugin/build/tmp/publishMavenJavaPublicationToMavenRepository/me/yifeiyuan/standalone-plugin/maven-metadata-remote.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | me.yifeiyuan 4 | standalone-plugin 5 | 6 | 1.0.1 7 | 8 | 1.0.1 9 | 10 | 20191216115442 11 | 12 | 13 | -------------------------------------------------------------------------------- /standalone-plugin/build/tmp/publishMavenJavaPublicationToMavenRepository/me/yifeiyuan/standalone-plugin/resolver-status.properties: -------------------------------------------------------------------------------- 1 | #NOTE: This is an internal implementation file, its format can be changed without prior notice. 2 | #Mon Dec 16 19:54:42 CST 2019 3 | maven-metadata-remote.xml.lastUpdated=1576497282727 4 | -------------------------------------------------------------------------------- /standalone-plugin/src/main/groovy/me/yifeiyuan/standalone/plugin/StandalonePlugin.groovy: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.standalone.plugin 2 | 3 | 4 | import org.gradle.api.Plugin 5 | import org.gradle.api.Project 6 | 7 | 8 | class StandalonePlugin implements Plugin { 9 | 10 | @Override 11 | void apply(Project project) { 12 | project.task("StandalonePlugin") { 13 | doLast { 14 | println("StandalonePlugin apply") 15 | } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /standalone-plugin/src/main/groovy/me/yifeiyuan/standalone/plugin/StandalonePlugin2.groovy: -------------------------------------------------------------------------------- 1 | package me.yifeiyuan.standalone.plugin 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | 6 | 7 | class StandalonePlugin2 implements Plugin { 8 | 9 | @Override 10 | void apply(Project project) { 11 | project.task("StandalonePlugin2") { 12 | doLast { 13 | println("StandalonePlugin 2 apply") 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /standalone-plugin/src/main/resources/META-INF/gradle-plugins/me.yifeiyuan.myplugin.properties: -------------------------------------------------------------------------------- 1 | implementation-class = me.yifeiyuan.standalone.plugin.StandalonePlugin -------------------------------------------------------------------------------- /standalone-plugin/src/main/resources/META-INF/gradle-plugins/me.yifeiyuan.myplugin2.properties: -------------------------------------------------------------------------------- 1 | implementation-class = me.yifeiyuan.standalone.plugin.StandalonePlugin2 --------------------------------------------------------------------------------