-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
166 lines (138 loc) · 3.9 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
* Copyright (c) 2018-2021 Chris K Wensel <[email protected]>. All Rights Reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
plugins {
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
apply from: 'etc/dependencyVersions.gradle'
apply from: 'etc/version.gradle'
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
repositories {
mavenCentral()
}
group = 'io.heretical'
version = releaseVersion
}
ext.copyright = '<i>Copyright © 2018-2023 Chris K Wensel. All Rights Reserved.</i>'
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: '../etc/testing.gradle'
sourceCompatibility = 11
targetCompatibility = 11
configurations {
testArtifacts {
extendsFrom testRuntime
}
}
javadoc {
title = "Mini Parsers ${releaseVersion}"
failOnError = false
configure( options ) {
linkSource = true
encoding = "UTF8"
bottom = copyright
links = [
'http://docs.oracle.com/javase/7/docs/api/',
'http://junit.sourceforge.net/javadoc/'
]
}
}
task sourcesJar( type: Jar, dependsOn: classes ) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
task javadocJar( type: Jar, dependsOn: javadoc ) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task testsJar( type: Jar, dependsOn: testClasses ) {
from sourceSets.test.output
archiveClassifier = 'tests'
}
task testSourcesJar( type: Jar, dependsOn: classes ) {
from sourceSets.test.allSource
archiveClassifier = 'test-sources'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
archives testsJar
archives testSourcesJar
testArtifacts testsJar
testArtifacts testSourcesJar
}
dependencies {
testCompile group: 'junit', name: 'junit', version: junitVersion
}
test {
include '**/*Test.class'
ignoreFailures = !System.getProperty( 'test.haltonerror', "true" ).equals( "true" )
}
// publish wips via publishAllPublicationsToGitHubPackagesRepository
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri( "https://maven.pkg.github.com/heretical/mini-parsers" )
credentials {
username = repoUserName ?: System.getenv( "GPR_USERNAME" )
password = repoPassword ?: System.getenv( "GPR_TOKEN" )
}
}
}
publications {
maven( MavenPublication ) {
artifact sourcesJar
artifact javadocJar
from components.java
pom {
name = 'Mini-Parsers'
description = 'An API for parsing small things.'
url = 'http://www.heretical.io/'
inceptionYear = '2018'
licenses {
license {
name = 'Mozilla Public License, v. 2.0'
url = 'http://mozilla.org/MPL/2.0/'
distribution = 'repo'
}
}
developers {
developer {
id = 'cwensel'
name = 'Chris K Wensel'
email = '[email protected]'
}
}
scm {
url = 'https://github.com/Heretical/mini-parsers.git'
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.maven
}
}
// publish releases via publishToSonatype closeAndReleaseSonatypeStagingRepository
nexusPublishing {
repositories {
sonatype {
nexusUrl.set( uri( "https://s01.oss.sonatype.org/service/local/" ) )
snapshotRepositoryUrl.set( uri( "https://s01.oss.sonatype.org/content/repositories/snapshots/" ) )
username = repoUserName ?: System.getenv( "MCR_USERNAME" )
password = repoPassword ?: System.getenv( "MCR_PASSWORD" )
}
}
}