-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
136 lines (117 loc) · 3.95 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
126
127
128
129
130
131
132
133
134
135
136
import org.gradle.api.attributes.java.TargetJvmVersion
plugins {
id 'com.gradle.plugin-publish' version '1.3.0'
id 'java-gradle-plugin'
id 'groovy'
id 'jacoco'
id 'signing'
id 'net.researchgate.release' version '3.1.0'
id 'ru.vyarus.quality' version '5.0.0'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'ru.vyarus.java-lib' version '3.0.0'
id 'ru.vyarus.github-info' version '2.0.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id "pl.droidsonroids.jacoco.testkit" version "1.0.12"
}
java {
sourceCompatibility = 1.8
}
wrapper {
gradleVersion = '8.6'
distributionType = Wrapper.DistributionType.BIN
}
// workaround to keep compileOnly android dependency together with target jdk 1.8
// attributes: https://docs.gradle.org/current/userguide/variant_attributes.html
// definition example https://docs.gradle.org/current/userguide/variant_aware_resolution.html#2_create_a_custom_outgoing_configuration
configurations.compileClasspath.attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 11)
repositories { mavenLocal(); mavenCentral(); google(); gradlePluginPortal() }
dependencies {
implementation 'org.codehaus.mojo:animal-sniffer:1.24'
// required to replace deprecated gradle GFileUtils
implementation 'commons-io:commons-io:2.18.0'
compileOnly 'com.android.tools.build:gradle:7.4.0'
compileOnly 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21'
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
}
group = 'ru.vyarus'
description = 'Gradle AnimalSniffer plugin'
github {
user 'xvik'
license 'MIT'
}
maven.pom {
developers {
developer {
id = 'xvik'
name = 'Vyacheslav Rusakov'
email = '[email protected]'
}
}
}
nexusPublishing {
repositories {
sonatype {
username = findProperty('sonatypeUser')
password = findProperty('sonatypePassword')
}
}
}
if (System.getenv("SNAPSHOT")) {
// https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-gradle#publishing-packages-to-github-packages
publishing {
repositories {
maven {
name = "GitHub"
url = "https://maven.pkg.github.com/xvik/gradle-animalsniffer-plugin"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}
// skip signing for jitpack (snapshots)
tasks.withType(Sign) { onlyIf { !(System.getenv('JITPACK') || System.getenv('SNAPSHOT')) }}
// Required signing properties for release: signing.keyId, signing.password and signing.secretKeyRingFile
// (https://docs.gradle.org/current/userguide/signing_plugin.html#sec:signatory_credentials)
javaLib {
// don't publish gradle metadata artifact
withoutGradleMetadata()
}
gradlePlugin {
plugins {
animalsnifferPlugin {
id = 'ru.vyarus.animalsniffer'
displayName = project.description
description = 'Gradle AnimalSniffer plugin for Java, Groovy, Kotlin and Scala projects'
tags.set(['animalsniffer'])
implementationClass = 'ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferPlugin'
}
}
}
release.git.requireBranch.set('master')
afterReleaseBuild {
dependsOn = [
'publishMavenPublicationToSonatypeRepository',
'closeAndReleaseSonatypeStagingRepository',
publishPlugins]
doLast {
logger.warn "RELEASED $project.group:$project.name:$project.version"
}
}
test {
useJUnitPlatform()
testLogging {
events 'skipped', 'failed'
exceptionFormat 'full'
}
maxHeapSize = '512m'
doLast {
sleep(1000)
}
systemProperty 'jna.nosys', 'true'
}
dependencyUpdates.revision = 'release'