This repository has been archived by the owner on Apr 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
128 lines (115 loc) · 3.34 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
plugins {
id 'com.diffplug.gradle.spotless' version '3.27.2'
id 'java-library'
id 'signing'
id 'maven-publish'
}
group = 'org.seasar.doma'
version = '2.28.1-SNAPSHOT'
ext.dependentVersion = '2.28.0'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.encoding = 'UTF-8'
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
spotless {
java {
googleJavaFormat('1.7')
}
}
compileJava {
doFirst {
ant.replaceregexp(
match: /(private static final String VERSION = ")[^"]*(")/,
replace: "\\1${version}\\2",
encoding: encoding,
flags: 'g') {
fileset(dir: '.') {
include(name: '**/Artifact.java')
}
}
ant.replaceregexp(
match: /('org.seasar.doma:doma-gen:)[^']*(')/,
replace: "\\1${version}\\2",
encoding: encoding,
flags: 'g') {
fileset(dir: 'docs') {
include(name: '**/*.rst')
}
}
}
options.encoding = encoding
}
compileTestJava {
options.encoding = encoding
options.compilerArgs = ['-proc:none']
}
javadoc {
options.encoding = encoding
options.charSet = encoding
options.docEncoding = encoding
exclude '**/internal/**'
}
jar {
manifest {
attributes 'Implementation-Title': 'Doma-Gen', 'Implementation-Version': archiveVersion
}
}
repositories {
mavenCentral()
mavenLocal()
maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}
}
dependencies {
annotationProcessor "org.seasar.doma:doma:${dependentVersion}"
implementation "org.seasar.doma:doma:${dependentVersion}"
implementation 'org.freemarker:freemarker:2.3.20'
implementation 'org.apache.ant:ant:1.9.3'
testImplementation 'junit:junit:4.11'
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = group
artifactId = project.name
version = version
from components.java
pom {
name = project.name
description = 'Code generator for Doma'
url = projectUrl
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'nakamura-to'
name = 'Toshihiro Nakamura'
email = 'toshihiro.nakamura@gmail.com'
}
}
scm {
connection = "scm:git:${githubUrl}"
developerConnection = "scm:git:${githubUrl}"
url = projectUrl
}
}
repositories {
maven {
url = isReleaseVersion ? sonatypeUrl : sonatypeSnapshotUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
build.dependsOn publishToMavenLocal
apply from:'eclipse.gradle'