forked from dokan-dev/dokan-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
115 lines (104 loc) · 2.75 KB
/
build.gradle
File metadata and controls
115 lines (104 loc) · 2.75 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
plugins {
id 'java'
id 'cpp'
id 'visual-studio'
id 'eclipse'
id 'maven-publish'
}
model {
repositories {
libs(PrebuiltLibraries) {
jni.headers.srcDirs "${System.env.JAVA_HOME}/include", "${System.env.JAVA_HOME}/include/win32"
dokan {
headers.srcDir System.env.DOKAN_HOME
binaries.withType(SharedLibraryBinary) {
sharedLibraryLinkFile = file("${System.env.DOKAN_HOME}/dokan.lib")
}
}
}
}
components {
'native'(NativeLibrarySpec) {
baseName 'jdokan'
binaries.all {
cppCompiler.define "UNICODE"
}
sources.cpp {
lib library: 'jni', linkage: 'api'
lib library: 'dokan', linkage: 'shared'
source {
srcDir "src/main/cpp"
include "**/*.cpp"
}
exportedHeaders {
srcDir "src/main/cpp/include"
}
}
}
}
tasks.compileNativeSharedLibraryNativeCpp { dependsOn generateHeader }
tasks {
matching { it.name.contains('LibVisualStudio') }.each { it.enabled = false }
matching { it.name.contains('StaticLibrary') }.each { it.enabled = false }
}
}
repositories {
jcenter()
}
dependencies {
compile 'com.google.guava:guava:18.0'
compile 'org.slf4j:slf4j-api:1.7.10'
compile 'ch.qos.logback:logback-classic:1.1.2'
testCompile 'com.google.jimfs:jimfs:1.0'
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.25'
}
eclipse {
project.natures 'org.springsource.ide.eclipse.gradle.core.nature'
}
task generateHeader {
dependsOn('classes')
def clazz = 'com.github.dokandev.dokanjava.Dokan'
def header = "${rootDir}/src/main/cpp/include/jdokan_jni.h"
inputs.file "${sourceSets.main.output.classesDir}/${clazz.replaceAll('.', '/')}"
outputs.file header
doLast {
ant.javah(class: clazz, outputFile: header, classpath: sourceSets.main.output.classesDir)
}
}
jar {
dependsOn('nativeSharedLibrary')
from 'build/binaries/nativeSharedLibrary/jdokan.dll'
}
// TODO: change this back to true when documentation is added
javadoc.failOnError = false
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
maven(MavenPublication) {
groupId 'com.github.dokan-dev.dokan-java'
artifactId 'dokan-java'
version '0.1-SNAPSHOT'
from components.java
artifact sourcesJar { classifier 'sources' }
artifact javadocJar { classifier 'javadoc' }
}
}
repositories {
maven {
name = 'SonatypeSnapshot'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
credentials {
username System.env.CI_DEPLOY_USERNAME
password System.env.CI_DEPLOY_PASSWORD
}
}
}
}