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
|
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0'
}
}
plugins {
id 'com.adarshr.test-logger' version '1.7.0'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.8.4'
}
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'biz.aQute.bnd.builder'
version = '@VERSION@'
group = 'com.github.tschoonj'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
libsDirName = '..'
repositories {
mavenCentral()
}
dependencies {
api 'org.apache.commons:commons-math3:3.6.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
}
sourceSets {
main {
java {
srcDir '@srcdir@'
exclude 'tests/**'
exclude 'gradle/**'
}
resources {
srcDir '@builddir@'
include 'xraylib.dat'
}
}
test {
java {
srcDir '@srcdir@/tests'
}
}
}
jar {
manifest {
attributes('Bundle-Vendor': 'Tom Schoonjans',
'Bundle-SymbolicName': 'com.github.tschoonj.xraylib',
'Automatic-Module-Name': 'com.github.tschoonj.xraylib',
'Bundle-Name': project.name,
'Export-Package': 'com.github.tschoonj.xraylib',
'-noee': true
)
}
}
task checkCompile(type: JavaCompile) {
source = fileTree('@top_srcdir@/example/')
include 'xrlexample7.java'
classpath = sourceSets.main.runtimeClasspath
options.sourcepath = files('@top_srcdir@/example')
destinationDir = file('.')
}
task checkRun(dependsOn: 'checkCompile', type: JavaExec) {
main = 'xrlexample7'
classpath = sourceSets.main.runtimeClasspath + files('.')
}
test {
useJUnitPlatform()
}
// based on https://blog.benoitblanchon.fr/gradle-how-to-make-a-flat-source-jar/
task flatSources(type: Copy) {
from sourceSets.main.allJava
into "$buildDir/flatSrc/com/github/tschoonj/xraylib"
}
task sourcesJar(type: Jar, dependsOn: flatSources) {
from "$buildDir/flatSrc"
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'xraylib'
description = 'A library for X-ray matter interaction cross sections for X-ray fluorescence applications'
url = 'https://github.com/tschoonj/xraylib'
licenses {
license {
name = '3-Clause BSD License'
url = 'https://opensource.org/licenses/BSD-3-Clause'
}
}
developers {
developer {
id = 'tschoonj'
name = 'Tom Schoonjans'
email = 'Tom.Schoonjans@gmail.com'
}
}
scm {
connection = 'scm:git:git://github.com/tschoonj/xraylib.git'
developerConnection = 'scm:git:git://github.com/tschoonj/xraylib.git'
url = 'https://github.com/tschoonj/xraylib.git'
}
}
}
}
}
bintray {
user = 'tschoonj'
key = System.getenv('BINTRAY_KEY')
pkg {
repo = 'maven'
name = 'xraylib'
userOrg = 'tschoonj'
licenses = ['BSD 3-Clause']
vcsUrl = 'https://github.com/tschoonj/xraylib.git'
version {
name = project.version
released = new Date()
}
}
// Upload the 'maven' publication i.e jar, sourcesJar, javadocJar, POM
publications = ['maven']
}
|