-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
91 lines (78 loc) · 2.65 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
plugins {
id 'java'
id 'maven'
id 'maven-publish'
}
group 'com.lifeinide.jsonql'
description 'Hibernate Search with ElasticSearch backend filter query builder for JSON-QL.'
/*
VERSION UPGRADE HOWTO:
1. Increment version here
2. Tag with the same version tag and push
3. Do `gradle publish`
*/
version '1.0.9'
sourceCompatibility = 1.8
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
def token = project.findProperty("token")
if (!token) {
try {
token = new File(System.getProperty("user.home"), ".github-token").text
logger.info("Using token from ~/.github-token.")
} catch (e) {
logger.warn("Please put personal github token into ~/.github-token file or pass it with -Ptoken=??? parameter.")
}
}
publishing {
publications {
mavenJava(MavenPublication) {
pom.withXml { // https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494/10
asNode().dependencies.'*'.each { it.scope*.value = 'compile'}
}
from components.java
artifact sourcesJar
// artifact javadocJar
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/json-ql/jsonql-core")
credentials {
username = project.findProperty("user") ?: "l0co"
password = token
}
}
}
}
repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/json-ql/jsonql-core")
credentials {
username = project.findProperty("user") ?: "l0co"
password = token
}
}
}
dependencies {
compile group: 'com.lifeinide.jsonql', name: 'jsonql-hibernate-search', version: property('vJsonqlHibernateSearch')
compile group: 'com.lifeinide.jsonql', name: 'jsonql-elastic-ql', version: property('vJsonqlElasticql')
compile group: 'org.hibernate', name: 'hibernate-search-elasticsearch', version: property('vHibernateSearch')
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: property('vJunit')
testCompile group: 'com.h2database', name: 'h2', version: property('vH2')
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: property('vJunit')
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: property('vLogback')
}
test {
useJUnitPlatform()
}
def installer = install.repositories.mavenInstaller