Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Sep 21, 2019
2 parents fe13696 + a6aad3f commit 7b1ecba
Show file tree
Hide file tree
Showing 76 changed files with 2,501 additions and 1,470 deletions.
7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 48 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,61 @@
Dokany-Java
Dokan-Java
======

# Important Notice
This project has switched to a new architecture. The _old_ dokan-java can be found under the deprecated branch and will be deleted after 6 months.

## Introduction
Dokany-Java is a Java wrapper for [Dokany 1.x release](https://github.com/dokan-dev/dokany/releases) and above.
Dokan-Java is a Java wrapper for [Dokany 1.x releases](https://github.com/dokan-dev/dokany/releases) and above. Using this project you are able to implement your own filesystem on Windows... in Java!

[Dokany](https://github.com/dokan-dev/dokany) is a device driver providing an interface to develop and run your own filesystem on Windows (similar to [FUSE](https://github.com/libfuse/libfuse)). Its native bindings are written in C/C++, this library provides via JNA a Java interface to its API with additional convenience methods.

## Runtime Dependencies
- [Java JRE 11](https://jdk.java.net/11/)

All dependencies can be seen [here](build.gradle).
All dependencies can be seen in the dependecies section of [the build file](build.gradle). The following are the primary dependencies:

- [JNA](https://github.com/java-native-access/jna) - provides access to [native Dokany functions](https://dokan-dev.github.io/dokany-doc/html/struct_d_o_k_a_n___o_p_e_r_a_t_i_o_n_s.html)
- [Commons IO](https://commons.apache.org/proper/commons-io/)
- [SLF4J](https://www.slf4j.org/)
- [Guava](https://github.com/google/guava)
- [JUnit 5](https://junit.org/junit5/)

## How to Use
There are 2 ways to directly use dokan-java:
1. Use a pre-built version
2. Build it yourself

### Pre-Built Version
The first stable release can be found here: https://bintray.com/infeo/maven/dokan-java

To use dokan-java in maven or gradle projects, you have to add jcenter as a repository and then find it under the following coordinates:
* Maven
```xml
<dependency>
<groupId>dev.dokan</groupId>
<artifactId>dokan_java</artifactId>
<version>1.1.0</version>
</dependency>
```
* Gradle
```groovy
dependencies {
implementation (group:'dev.dokan', name:'dokan_java', version:'1.1.0')
}
```

A publication to [MavenCentral](https://repo.maven.apache.org/maven2/) is in progress.

## How to Build
TODO
### Build Instructions
Prerequisite: [JDK 11](https://jdk.java.net/11/)

Building a jar using [Gradle](https://gradle.org/):
1. Open Terminal
2. Navigate to the root folder of the project
3. Execute `./gradlew.bat jar`

To publish to a local Maven repository, execute as the third step `./gradlew.bat publishToMavenLocal`

## Examples
Example user filesystems using this library, see the examples package [dev.dokan.dokan_java.examples](https://github.com/dokan-dev/dokan-java/tree/develop/src/main/java/dev/dokan/dokan_java/examples).

## Contributing
You're encouraged to contribute. Fork the code and then submit a pull request.

## Development Examples
For an example on how to develop using this library, see the examples package [com.dokan.java.examples](https://github.com/dokan-dev/dokan-java/tree/develop/src/main/java/com/dokan/java/examples).
## License
This library is licensed under [GNU LGPLv3](LICENSE).
96 changes: 59 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* This file was generated by the Gradle 'init' task.
*
* It describes how to build the dokan-java project.
* In order to be able to build then library one must define the gradle properties "bintrayUser" and "bintrayApiKey" in your ~/.gradle/gradle.properties file with some random values
*
* To publish to the local Maven repository, execute 'gradle publishToMavenLocal'
*/
Expand All @@ -14,6 +13,7 @@ plugins {
id 'com.jfrog.bintray' version '1.8.4'
}


dependencies {
implementation (group:'com.google.guava', name:'guava', version:guavaVersion)
implementation (group:'net.java.dev.jna', name:'jna', version:jnaVersion)
Expand All @@ -23,9 +23,9 @@ dependencies {
api (group:'org.slf4j', name:'slf4j-api', version:slf4jVersion) //is this correct or should it be implementation?

testImplementation (group:'org.slf4j', name:'slf4j-simple', version:'1.7.25')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testImplementation (group:'org.junit.jupiter', name:'junit-jupiter-api', version:'5.3.1')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testRuntimeOnly (group:'org.junit.jupiter', name:'junit-jupiter-engine', version:'5.3.1')
}

// In this section you declare where to find the dependencies of your project
Expand All @@ -34,10 +34,23 @@ repositories {
jcenter()
}

//Check if the bintray credentials are defined, otherwise set them to dummy values
ext {
if(project.hasProperty('bintrayUsername')){
bintrayUser = bintrayUsername
} else {
bintrayUser = 'NOT DEFINED'
}
if(project.hasProperty('bintrayApiKey')){
bintrayKey = bintrayApiKey
} else {
bintrayKey = 'NOT DEFINED'
}
}

bintray{
user = bintrayUser
key = bintrayApiKey
key = bintrayKey
publications = ['release']
pkg {
version {
Expand All @@ -47,13 +60,13 @@ bintray{
vcsTag = project.version
gpg {
sign = true
passphrase = System.getenv("PWD")
}
}
repo = 'maven'
name = project.name
licenses = ['LGPL-3.0']
vcsUrl = scmUrl

}
}

Expand All @@ -72,11 +85,19 @@ task javadocJar(type: Jar) {
}

task showBintrayInfo() {
description 'Shows your system bintray credentials'
description 'Shows your system bintray credentials, if defined, otherwise NOT DEFINED '
group 'bintray'
doLast() {
println bintrayUser
print bintrayApiKey
print bintrayKey
}
}

task showProjectInfo(){
doLast() {
println project.name
println project.version
println project.description
}
}

Expand All @@ -86,50 +107,51 @@ tasks {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Specification-Title': 'Java Wrapper for Dokany',
'Specification-Title': project.description,
'Specification-Version': project.version,
)
}
}
}

def pomConfig = {
licenses {
license {
name licenseName
url licenseUrl
distribution "repo"
}
}

developers {
developer {
id maintainerId
name maintainer
email maintainerMail
timezone '+1'
}
}

scm {
url scmUrl
}
}

publishing {
publications {
release(MavenPublication) {
from components.java
groupId group
artifactId artifact
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', project.description)
root.appendNode('name', project.name)
root.appendNode('url', scmUrl)
root.children().last() + pomConfig
pom {
name = project.name
description = project.description
url = scmUrl
licenses {
license {
name = licenseName
url = licenseUrl
distribution = "repo"
}
}
developers {
developer {
id = maintainerId
name = maintainer
email = maintainerMail
timezone = '+1'
}
}
scm {
connection = 'scm:git:git://github.com/dokan-dev/dokan-java.git'
url = scmUrl
}
}
}
}
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
2 changes: 1 addition & 1 deletion dokan-java.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="dokan-java" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="com.dokan" external.system.module.version="1.0.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<module external.linked.project.id="dokan-java" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="dev.dokan" external.system.module.version="1.1.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
Expand Down
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version=1.0.0
group=com.dokan
name=dokan-java
version=1.1.0
group=dev.dokan
artifact=dokan_java
description=A Java wrapper for Dokany (https://dokan-dev.github.io/)

scmUrl=https://github.com/dokan-dev/dokan-java
Expand All @@ -14,7 +16,7 @@ licenseName=GNU Lesser General Public License, Version 3.0
licenseUrl=https://www.gnu.org/licenses/lgpl-3.0.en.html

#lib versions
jnaVersion=5.0.0
jnaVersion=5.4.0
guavaVersion=27.0-jre
slf4jVersion=1.7.25
apacheCommonsIOVersion=2.6
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 19 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
Loading

0 comments on commit 7b1ecba

Please sign in to comment.