This repository was archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.gradle
More file actions
161 lines (138 loc) · 4.4 KB
/
build.gradle
File metadata and controls
161 lines (138 loc) · 4.4 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
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
158
159
160
161
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id 'java-library'
id 'maven-publish'
//Remove 'com.jfrog.artifactory' plugin if you are not using Artifactory
id 'com.jfrog.artifactory' version '4.17.2'
}
allprojects {
repositories {
jcenter()
mavenCentral()
//Remove maven{} block if you are not using Artifactory, otherwise define your own values in the gradle.properties file
maven {
credentials{
username artifactory_username
password artifactory_password
}
url artifactory_path_android_libraries
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation fileTree(include: ['*.jar', "*.dylib", "*.so"], dir: 'libs')
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation group: 'org.json', name: 'json', version: '20200518'
implementation 'one.block:eosiojava:1.0.0'
implementation 'org.jetbrains:annotations:17.0.0'
}
jar {
dependsOn 'copyNativeLibrary'
// Copy lib file before jar is created
from('eosiojavaabieos/build/lib/main/debug') {
include '**/*.so'
include '**/*.dylib'
into('eosiojavaabieos/build/lib/main/debug')
}
}
task copyNativeLibrary(type: Copy) {
dependsOn ':eosiojavaabieos:linkDebug'
// Copy lib to /resources so tests can run within project (outside of gradle task)
from ('eosiojavaabieos/build/lib/main/debug') {
include '**/*.so'
include '**/*.dylib'
}
into 'src/main/resources/eosiojavaabieos/build/lib/main/debug'
}
test {
dependsOn 'copyNativeLibrary'
systemProperty "java.library.path", file("${project(":eosiojavaabieos").buildDir}/lib/main/debug").absolutePath
testLogging {
events "passed", "skipped", "failed"
}
}
task gitSubmodulesUpdate {
exec {
commandLine 'git', 'submodule', 'update', '--init', '--recursive'
}
}
task deleteCopiedNativeLibrary(type: Delete) {
dependsOn('gitSubmodulesUpdate')
delete fileTree(include: ["*.dylib", "*.so"], dir: 'src/main/resources/eosiojavaabieos/build/lib/main/debug')
}
clean.dependsOn 'deleteCopiedNativeLibrary'
def libraryGroupId = 'one.block'
def libraryArtifactId = 'eosio-java-abieos-serialization-provider'
def libraryVersion = '1.0.0'
task sourcesJar(type: Jar, dependsOn: classes){
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc){
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
jar(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId libraryGroupId
version libraryVersion
artifactId libraryArtifactId
artifact("$buildDir/libs/${artifactId}.jar")
pom {
name = 'EOSIO SDK for Java: ABIEOS Serialization Provider'
description = 'ABIEOS Serialization Provider is intended to be used in conjunction with EOSIO SDK for Java as a provider plugin.'
url = 'https://github.com/EOSIO/eosio-java-abieos-serialization-provider/'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/EOSIO/eosio-java-abieos-serialization-provider/blob/master/LICENSE'
}
}
developers {
developer {
id = 'block.one'
name = 'Block One'
email = 'dev@block.one'
}
}
}
}
}
}
//Remove artifactory{} block if you are not using Artifactory
artifactory {
contextUrl = artifactory_contextURL
publish {
repository {
repoKey = artifactory_repo
username = artifactory_username
password = artifactory_password
}
defaults {
publications('jar')
publishArtifacts = true
properties = ['qa.level': 'basic', 'dev.team': 'core']
publishPom = true
}
}
}