@@ -5,43 +5,79 @@ group 'com.github.newnewcoder'
5
5
6
6
buildscript {
7
7
repositories {
8
- maven {
9
- url " https://plugins.gradle.org/m2/"
10
- }
8
+ jcenter()
11
9
}
12
10
dependencies {
13
- classpath " com.gradle.publish:plugin-publish -plugin:0.9.7 "
11
+ classpath ' com.jfrog.bintray.gradle:gradle-bintray -plugin:1.7.3 '
14
12
}
15
13
}
16
- apply plugin : " com.gradle.plugin-publish "
14
+ apply plugin : ' com.jfrog.bintray '
17
15
apply plugin : ' groovy'
18
16
apply plugin : ' maven'
17
+ apply plugin : ' maven-publish'
19
18
20
19
repositories {
21
- jcenter()
22
20
mavenCentral()
23
21
}
22
+
24
23
ext {
25
- linebotVersion = ' 1.6.0'
24
+ archivesBaseName = ' linepush-gradle-plugin'
25
+ description = ' It\' s a gradle plugin using *line-bot message push api* to send line message.'
26
+ }
27
+
28
+ task sourceJar (type : Jar , dependsOn : classes, description : ' Package source into jar' ) {
29
+ classifier = ' sources'
30
+ from sourceSets. main. allSource
31
+ }
32
+
33
+ task groovydocJar (type : Jar , dependsOn : groovydoc, description : ' Package doc into jar' ) {
34
+ classifier = ' groovydoc'
35
+ from groovydoc. destinationDir
26
36
}
37
+
38
+ artifacts {
39
+ archives sourceJar, groovydocJar
40
+ }
41
+
27
42
dependencies {
43
+ def linebotVersion = ' 1.6.0'
28
44
compile gradleApi()
29
45
compile localGroovy()
30
46
compile " com.linecorp.bot:line-bot-api-client:$linebotVersion "
31
47
32
48
testCompile ' junit:junit:4.11'
33
49
}
34
50
35
- pluginBundle {
36
- website = ' https://github.com/newnewcoder/linepush'
37
- vcsUrl = ' https://github.com/newnewcoder/linepush'
38
- tags = [' linepush' ]
39
- description = ' It\' s a gradle plugin using *line-bot message push api* to send line message.'
51
+ publishing {
52
+ publications {
53
+ MyPublication (MavenPublication ) {
54
+ from components. java
55
+ groupId = project. group
56
+ artifactId = project. archivesBaseName
57
+ version = project. version
58
+ artifact sourceJar
59
+ artifact groovydocJar
60
+ }
61
+ }
62
+ }
40
63
41
- plugins {
42
- linepushPlugin {
43
- id = " com.github.newnewcoder.linepush"
44
- displayName = ' Gradle LinePush plugin'
64
+ bintray {
65
+ user = project. hasProperty(' bintrayUser' ) ? project. property(' bintrayUser' ) : System . getenv(' BINTRAY_USER' )
66
+ key = project. hasProperty(' bintrayApiKey' ) ? project. property(' bintrayApiKey' ) : System . getenv(' BINTRAY_API_KEY' )
67
+ publications = [' MyPublication' ]
68
+ pkg {
69
+ repo = ' generic'
70
+ name = ' linepush-gradle-plugin'
71
+ userOrg = user
72
+ licenses = [' Apache-2.0' ]
73
+ vcsUrl = ' https://github.com/newnewcoder/linepush'
74
+ labels = [' linepush' , ' gradle plugin' ]
75
+ publish = true
76
+ publicDownloadNumbers = true
77
+ version {
78
+ name = project. version
79
+ desc = project. description
80
+ released = new Date ()
45
81
}
46
82
}
47
83
}
0 commit comments