“This is the 20th day of my participation in the August Gwen Challenge.
preface
GRADLE.ORG: JCenter is going to be out of service and all dependencies will become invalid. GRADLE.ORG:
Step 1: Create an account.
Click register.
Registered address: plugins.gradle.org/user/regist…
Step 2: Generate the API key.
Add the API key to the Gradle configuration.
Copy API Key to computer $USER_HOME /. Gradle/gradle. The properties file, if the computer doesn’t have the file, is to create one
$USER_HOME refers to your computer username
If you don’t mind manually configuring the API, you can use the official Login Task to automatically register,
After login Task is executed, the authorization link will appear in the execution window. Click the browser to open it
To do this, you need to apply the plugin. See below:
Step 4: Use official plug-ins to push code.
Add the following code to your own plugin project build.gradle
// The first step is to apply the plug-in
plugins {
id "com.gradle.plugin-publish" version "0.10.1"
}
pluginBundle {
website = 'http://www.gradle.org/'// The official address of your plugin
vcsUrl = 'https://github.com/gradle/gradle'// Plugin version sync address fill in your Github address
description = 'Greetings from here! '// Plug-in description
tags = ['greetings'.'salutations']// Tags are easy to search
plugins {
greetingsPlugin {
version = "1.2" // Plug-in version number
group = "com.foo.myplugin"// Plug-in package name
displayName = 'Fill in the name shown on the plugin website'}}}Copy the code
When the configuration is complete, execute the publishPlugins task to automatically upload the code
Step 5: Wait for approval.
After the approval, you can search your plug-in on the official website, which is attached with the use of the plug-in