-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
125 lines (114 loc) · 4.09 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
113
114
115
116
117
118
119
120
121
122
123
124
125
buildscript {
ext.versions = [asm : '7.3.1',
kotlin : '1.3.70',
android: [gradle: '3.6.0',],]
repositories {
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.28.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.11.0'
}
}
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'pl.allegro.tech.build.axion-release'
scmVersion {
tag {
prefix = ''
}
hooks {
pre 'fileUpdate', [file : 'README.md',
pattern : { v, p -> /([-\/:])$v([-\/'])/ },
replacement: { v, p -> "\$1$v\$2" }]
pre 'commit', { v, p -> "Release version: $v [ci skip]" }
}
}
version = scmVersion.version
group = 'com.github.tmurakami'
repositories {
google()
mavenCentral()
jcenter()
}
configurations {
ktlint
}
dependencies {
ktlint 'com.github.shyiko:ktlint:0.31.0'
implementation gradleApi()
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}"
implementation "org.ow2.asm:asm:${versions.asm}"
compileOnly("com.android.tools.build:gradle:${versions.android.gradle}")
testImplementation 'junit:junit:4.13'
testImplementation 'com.google.truth:truth:1.0.1'
testImplementation 'io.mockk:mockk:1.9.3'
testImplementation "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}"
testImplementation "com.android.tools.build:gradle-api:${versions.android.gradle}"
testImplementation 'com.google.android:android:4.1.1.4'
testImplementation 'org.objenesis:objenesis:3.1'
testImplementation "org.ow2.asm:asm-util:${versions.asm}"
}
dependencyUpdates.resolutionStrategy {
componentSelection.all {
if (candidate.version =~ /(?i)-(?:alpha|beta|rc)[-\d]?/) reject('Release candidate')
}
}
task ktlint(type: JavaExec, group: 'verification') {
inputs.files fileTree(dir: 'src', include: '**/*.kt')
outputs.dir 'src'
description = 'Check Kotlin code style.'
classpath = configurations.ktlint
main = 'com.github.shyiko.ktlint.Main'
args 'src/**/*.kt'
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: 'formatting') {
inputs.files fileTree(dir: 'src', include: '**/*.kt')
outputs.dir 'src'
description = 'Fix Kotlin code style deviations.'
classpath = configurations.ktlint
main = 'com.github.shyiko.ktlint.Main'
args '-F', 'src/**/*.kt'
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'SplitCompat weaver'
description = "A Gradle plugin which automatically weaves 'SplitCompat#install' " +
"calls into activities and services in a dynamic feature module"
url = 'https://github.com/tmurakami/splitcompat-weaver-gradle-plugin'
inceptionYear = '2019'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'tmurakami'
name = 'Tsuyoshi Murakami'
}
}
scm {
connection = 'scm:git:https://github.com/tmurakami/splitcompat-weaver-gradle-plugin.git'
developerConnection = 'scm:git:ssh://github.com/tmurakami/splitcompat-weaver-gradle-plugin.git'
url = 'https://github.com/tmurakami/splitcompat-weaver-gradle-plugin'
}
}
}
mavenSources(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}