-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.gradle
More file actions
126 lines (110 loc) · 3.73 KB
/
build.gradle
File metadata and controls
126 lines (110 loc) · 3.73 KB
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
///////////////////////////////////////////////////////////////////////////////
//
// Build Script for building JavaPOS Contracts Library
//
// Author: denis.kuniss@dieboldnixdorf.com (2021)
//
///////////////////////////////////////////////////////////////////////////////
plugins {
id 'java-library'
id 'signing'
id 'eclipse'
id 'maven-publish'
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id 'project-report'
}
wrapper {
gradleVersion = '8.14.3'
}
///////////////////////////////////////////////////////////////////////////////
// Names and Versions
///////////////////////////////////////////////////////////////////////////////
def artifactName = 'javapos-contracts'
group='org.javapos'
def uposVersion = '1.15' // if this version is going to be changed, first add "-SNAPSHOT" to the
// 'version' variable below for publishing to MavenCentral's Snapshot repo first as test
version="${uposVersion}.6-SNAPSHOT" // the last part after dot is the build/release version
///////////////////////////////////////////////////////////////////////////////
// Project Configurations
///////////////////////////////////////////////////////////////////////////////
// let method parameters be written to the class file to be returned by java.lang.reflect.Method.getParameter()
eclipse.jdt.file.withProperties { properties ->
properties['org.eclipse.jdt.core.compiler.codegen.methodParameters'] = 'generate'
}
def javaposManifest = java.manifest {
attributes('Specification-Title': 'UnifiedPOS Standard',
'Specification-Vendor': 'UnifiedPOS Committee',
'Specification-Version': uposVersion,
'Implementation-Title': 'JavaPOS Contracts',
'Implementation-Vendor': 'github.com/JavaPOSWorkingGroup',
'Implementation-Version': version)
}
///////////////////////////////////////////////////////////////////////////////
// Build Tasks
///////////////////////////////////////////////////////////////////////////////
java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_1_8
}
jar {
archiveBaseName = artifactName
manifest = javaposManifest
from ('CHANGELOG.md') {
into 'META-INF'
}
}
sourcesJar {
manifest = javaposManifest
from ('CHANGELOG.md') {
into 'META-INF'
}
}
///////////////////////////////////////////////////////////////////////////////
// Artifact Upload
///////////////////////////////////////////////////////////////////////////////
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
def githubProjectUrl = 'https://github.com/JavaPOSWorkingGroup/javapos-contracts'
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = artifactName
description = 'JavaPOS Contracts Library'
url = githubProjectUrl
licenses {
license {
name = 'Common Public License (CPL) -- V1.0'
url = 'https://www.eclipse.org/legal/cpl-v10.html'
}
}
developers {
developer {
id = 'javapos'
name = 'JavaPOS Working Group'
email = 'builder@javapos.org'
}
}
scm {
connection = "scm:${githubProjectUrl}.git"
developerConnection = "scm:git:${githubProjectUrl}.git"
url = "${githubProjectUrl}.git"
}
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}