try some more tweaks to get signing and src/javadoc artifacts working

parent 49df1809
Pipeline #519 failed with stages
in 1 minute and 13 seconds
......@@ -49,15 +49,19 @@ repositories {
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allJava
classifier = 'sources'
extension 'jar'
group 'build'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
extension 'jar'
group 'build'
}
artifacts {
archives sourcesJar, javadocJar
archives jar, sourcesJar, javadocJar
}
artifactoryPublish.dependsOn('clean', 'build', 'javadocJar', 'sourcesJar')
......@@ -129,16 +133,17 @@ idea {
}
}
signing {
sign configurations.archives
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact (sourcesJar) {
classifier = 'sources'
}
artifact (javadocJar) {
classifier = 'javadoc'
}
artifact sourcesJar
artifact javadocJar
/*pom {
name = 'BullTech Util'
description = 'Basic utility classes'
......@@ -162,16 +167,42 @@ publishing {
url = 'https://git.tomasu.org/java/util'
}
}*/
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}
// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
//artifact(file("$rootDir/gradle.properties"))
}
}
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
options {
setMemberLevel JavadocMemberLevel.PUBLIC
setAuthor true
links "https://docs.oracle.com/javase/8/docs/api/"
}
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
......
......@@ -148,6 +148,19 @@ class Preconditions
throw new IllegalArgumentException(String.format(format, args));
}
public static
boolean checkArgument(Object instance, Class<?> type)
{
if (type.isInstance(instance))
{
return true;
}
String message = String.format("Expected argument of type %s. Got %s.",
ClassUtil.simpleName(type), ClassUtil.simpleName(instance));
throw new IllegalArgumentException(message);
}
public static
boolean checkPositionIndex(int size, int position)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment