-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
112 lines (99 loc) · 2.87 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
}
plugins {
id 'groovy'
id "java"
id "java-gradle-plugin"
id "maven-publish"
id "signing"
id 'com.gradle.plugin-publish' version '1.2.1'
}
group 'com.ly.smart-doc'
version '3.0.9'
sourceCompatibility = 1.8
repositories {
mavenLocal() // This is to access the local Maven repository.
maven { url 'https://maven.aliyun.com/repository/public' }
mavenCentral()
}
dependencies {
implementation group: 'com.ly.smart-doc', name: 'smart-doc', version: '3.0.9'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task javadocJar(type: Jar) {
archiveClassifier = "javadoc"
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
javadoc {
configure(options) {
tags(
'todo:X"',
'apiNote:a:"API Note:"',
'implSpec:a:"Implementation Requirements:"',
'implNote:a:"Implementation Note:"',
)
}
}
// publish to https://plugins.gradle.org/
gradlePlugin {
website = 'https://github.com/TongchengOpenSource/smart-doc-gradle-plugin'
vcsUrl = 'https://github.com/TongchengOpenSource/smart-doc-gradle-plugin'
plugins {
create("smartdocPlugin") {
id = 'com.ly.smart-doc'
implementationClass = 'com.ly.doc.gradle.plugin.SmartDocPlugin'
displayName = 'smart-doc gradle plugin'
description = 'smart-doc gradle plugin'
tags.set(['smart-doc', 'gradle-plugin'])
}
}
}
// publish to local, see https://docs.gradle.org/current/userguide/publishing_maven.html
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.name
version "${version}"
from components.java
}
}
repositories {
mavenLocal() // install to '~/.m2/repository`
maven {
allowInsecureProtocol(true)
url "http://localhost:8081/nexus/content/repositories/releases/"
credentials {
username 'admin'
password 'admin123'
}
}
}
}
signing {
// Sign all publications by default
sign publishing.publications
// Skip signing when certain tasks are executed
required {
!project.hasProperty('skipSigning') &&
!project.gradle.startParameter.taskNames.any { it.contentEquals("publishToMavenLocal") } &&
!project.gradle.startParameter.taskNames.any { it.contentEquals("publishPlugins") }
}
}