-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
206 lines (168 loc) · 5.62 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
}
}
plugins {
id 'java-library'
id "com.jfrog.bintray" version "1.8.4"
id 'java'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
// *****************************************************************************************
// Paths to local micro-manager files
import org.gradle.internal.os.OperatingSystem
String core_plugin_path
String app_path
/***
* Provide the core_plugin_path to your installation of micromanager 2.0
* Privde the app_path to the installation used for testing
*/
if(OperatingSystem.current().isMacOsX()) {
core_plugin_path = '/Applications/Micro-Manager-2.0.0-gamma1-20190806/plugins/Micro-Manager'
app_path = '/Applications/Micro-Manager-2.0.0-gamma1-20190806/'
} else if(OperatingSystem.current().isWindows()) {
core_plugin_path = 'C:\\Applications\\Micro-Manager-2.0.0-gamma1-20190806\\plugins\\Micro-Manager'
app_path = 'C:\\Applications\\Micro-Manager-2.0.0-beta3-20181001'
}
// *****************************************************************************************
// Java Code Building
sourceSets
{
main
{
java
{ srcDir 'src/main/java' }
}
test
{
java
{ srcDir 'src/test/java' }
}
}
configurations {
compile
core_libs
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
testLogging {
events "passed", "skipped", "failed"
}
exclude '**/demo/**'
maxHeapSize = "4G"
}
dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:23.0'
testImplementation 'org.mockito:mockito-inline:2.13.0'
// JUnit 5
compile group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.2.0'
compile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.2.0'
compile group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.2.0'
// Mockito
compile group: 'org.mockito', name: 'mockito-core', version: '3.0.0'
// compile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.0.0'
// PowerMock
// compile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4'
// compile group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.2'
// Micromanager core jars
// somehow, micro-manager depends critically on this distributed scijava .jar
compile fileTree(include: ['MMCoreJ.jar', 'MMJ_.jar', 'scijava-common-2.77.0.jar'], exclude: 'mm2Python.jar', dir: core_plugin_path)
compile fileTree(include: ['ij.jar'], dir: app_path)
//zeroMQ
compile group: 'org.zeromq', name: 'jeromq', version: '0.5.1'
core_libs group: 'org.zeromq', name: 'jeromq', version: '0.5.1'
//Py4J
compile group: 'net.sf.py4j', name: 'py4j', version: '0.10.8.1'
core_libs group: 'net.sf.py4j', name: 'py4j', version: '0.10.8.1'
// IntelliJ org.mm2python.UI Designer
compile group: 'com.intellij', name: 'forms_rt', version: '7.0.3'
core_libs group: 'com.intellij', name: 'forms_rt', version: '7.0.3'
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://computational-microscopy.bintray.com/mmtest"
}
}
jar {
archiveName = "mm2python_v0.0.2.jar"
from {
configurations.core_libs.collect {it.isDirectory() ? it : zipTree(it) }
}
}
task copyCoreToMM(type: Copy) {
if(OperatingSystem.current().isMacOsX()) {
from 'build/libs/mm2python_v0.0.2.jar'
into app_path + "/plugins/Micro-Manager"
}
else if(OperatingSystem.current().isWindows()) {
from 'build/libs/mm2python_v0.0.2.jar'
into app_path + "\\plugins\\Micro-Manager"
} else {
println "unsupported OS"
}
}
//***********************************************************************************
// PUBLISHING
//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
//}
archivesBaseName = 'mm2python'
group = 'bryantchhungroup'
version = '0.0.1'
description = 'desc. for mm2python'
bintray {
// DO NOT PUT YOUR KEY HERE. Set your computer's system environment variable instead.
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publications = ['MyPublication']
publish = true
pkg {
repo = 'mmtest'
name = 'mm2pythonpkgname'
// userOrg = 'computational-microscopy'
userOrg = 'bryantchhun'
licenses = ['BSD-3-Clause']
vcsUrl = 'https://github.com/czbiohub/mm2python.git'
version {
name = project.version
desc = 'my first bintray upload'
released = new Date()
// vcsTag = '0.0.1'
// attributes = ['']
}
}
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId = project.group
artifactId = project.archivesBaseName
version = project.version
}
}
}