Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

Commit df72416

Browse files
committed
Move client cli to own package
1 parent c263ed8 commit df72416

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

client-cli/build.gradle

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apply plugin: 'application'
2+
mainClassName = 'net.syncthing.java.client.cli.Main'
3+
4+
dependencies {
5+
compile project(':syncthing-java')
6+
compile project(':repository')
7+
compile "commons-cli:commons-cli:1.4"
8+
}
9+
10+
run {
11+
if (project.hasProperty('args')) {
12+
args project.args.split('\\s+')
13+
}
14+
}

client/src/main/kotlin/net/syncthing/java/client/Main.kt client-cli/src/main/kotlin/net/syncthing/java/client/cli/Main.kt

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,14 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package net.syncthing.java.client
14+
package net.syncthing.java.client.cli
1515

16-
// this is archived
17-
//
18-
// I'm not sure if anyone still needs it. If someone needs it,
19-
// it should be moved to an other package because the SqlRepository
20-
// should not be a dependency of this module.
21-
22-
/*
2316
import net.syncthing.java.core.beans.DeviceId
2417
import net.syncthing.java.core.beans.DeviceInfo
2518
import net.syncthing.java.core.beans.FileInfo
2619
import net.syncthing.java.core.configuration.Configuration
20+
import net.syncthing.java.repository.repo.SqlRepository
21+
import net.syncthing.java.client.SyncthingClient
2722
import org.apache.commons.cli.*
2823
import org.apache.commons.io.FileUtils
2924
import org.slf4j.LoggerFactory
@@ -48,7 +43,9 @@ class Main(private val commandLine: CommandLine) {
4843
val configuration = if (cmd.hasOption("C")) Configuration(File(cmd.getOptionValue("C")))
4944
else Configuration()
5045

51-
SyncthingClient(configuration).use { syncthingClient ->
46+
val repository = SqlRepository(configuration.databaseFolder)
47+
48+
SyncthingClient(configuration, repository, repository).use { syncthingClient ->
5249
val main = Main(cmd)
5350
cmd.options.forEach { main.handleOption(it, configuration, syncthingClient) }
5451
}
@@ -229,4 +226,3 @@ class Main(private val commandLine: CommandLine) {
229226
latch.await()
230227
}
231228
}
232-
*/

client/build.gradle

-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
apply plugin: 'application'
2-
mainClassName = 'net.syncthing.java.client.Main'
3-
41
dependencies {
52
compile project(':core')
63
compile project(':bep')
74
compile project(':discovery')
8-
compile "commons-cli:commons-cli:1.4"
9-
}
10-
11-
run {
12-
if (project.hasProperty('args')) {
13-
args project.args.split('\\s+')
14-
}
155
}

settings.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ include ':bep'
66
include ':client'
77
include ':repository'
88
include ':discovery'
9+
include ':client-cli'
910

1011
// Also call this syncthing-java so it can be easily used from syncthing-lite.
11-
project(':client').name = 'syncthing-java'
12+
project(':client').name = 'syncthing-java'

0 commit comments

Comments
 (0)