-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
152 lines (119 loc) · 4.16 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
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.16"
}
}
plugins {
id "org.jetbrains.kotlin.plugin.noarg" version "1.2.20"
id "at.comm_unity.gradle.plugins.jpamodelgen" version "1.1.4"
}
group 'com.kameocode'
archivesBaseName = "any-dao"
version '1.0.3-SNAPSHOT'
description 'AnyDAO is an Kotlin JPA wrapper library which makes your database queries short, clean and easy to read.'
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'kotlin-jpa'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compile
}
jpaModelgen {
jpaModelgenSourcesDir = 'src/generated/java'
}
compileJpaModelgen {
includes += ['**/test/helpers/*.java']
}
dependencies {
compileOnly group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: '1.0.2.Final'
// kotlin libraries
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compileOnly "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// tests
testCompile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.2.16.Final'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "com.h2database:h2:1.4.196"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
inputs.dir 'src/main/kotlin'
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc, group: "documentation") {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
archives javadocJar
}
if (project.hasProperty('signing.keyId')) {
signing {
sign configurations.archives
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
String tossrhUsername = project.hasProperty('ossrhUsername') ? ossrhUsername : ""
String tossrhPassword = project.hasProperty('ossrhPassword') ? ossrhPassword : ""
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: tossrhUsername, password: tossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: tossrhUsername, password: tossrhPassword)
}
//repository(url: mavenLocal().url)
pom.project {
name = "${project.group}:${archivesBaseName}"
description = project.description
url = 'https://github.com/kameocode/any-dao'
inceptionYear = '2018'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id = 'vinga'
name = 'Kamila Myczkowska'
email = '[email protected]'
organization = 'KameoCode'
organizationUrl = 'http://kameocode.com'
}
}
scm {
connection 'scm:git:git://github.com/kameocode/any-dao.git'
developerConnection 'scm:git:ssh://github.com/kameocode/any-dao.git'
url 'http://github.com/kameocode/any-dao/tree/master'
}
}
}
}
}