Skip to content

Commit 1c38a63

Browse files
authored
Merge pull request #2 from ev3dev-lang-java/plugin
Integrate plugin support
2 parents 0688aca + b1346fe commit 1c38a63

File tree

30 files changed

+217
-154
lines changed

30 files changed

+217
-154
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
22
*.iml
3-
3+
/build
4+
/*/build
5+
.gradle

README.md

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
11
# ev3dev-lang-java /examples
22

3-
This repository store a set of examples ready to use with the
3+
This repository store a set of examples ready to use with the
44
ev3dev-lang-java libraries.
55

6+
## Checking it out
7+
8+
Before proceeding further, you need to change the brick connection parameters
9+
in the `config.gradle` file in the main directory.
10+
11+
You can build the project and upload all programs with their dependencies with these commands:
12+
```sh
13+
./gradlew uploadGradleLibraries
14+
./gradlew deploy
15+
```
16+
17+
You can then run them from the ev3dev menu in the `examples` subdirectory.
18+
19+
Alternatively, you can also work only with one project at a time:
20+
```sh
21+
./gradlew :opencv:deploy # only upload 'opencv' project
22+
./gradlew :opencv:run # only run already uploaded build of 'opencv' project
23+
./gradlew :opencv:deployRun # only upload and run 'opencv' project
24+
```
25+
26+
To change the class to be run in some example project, modify its `config.gradle` file.
27+
If you run want to run the program from ev3dev menu, you will have to reupload it.
28+
29+
To remove all samples from the brick, just run:
30+
```sh
31+
./gradlew undeploy
32+
```
33+
34+
## Contents
35+
636
Take a look the following examples to discover some features included with this Java project.
737

838
**EV3Dev-lang-Java:**
@@ -68,19 +98,19 @@ Take a look the following examples to discover some features included with this
6898

6999
- lejos.robotics.navigation
70100
- [PilotConfig](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/PilotConfig.java)
71-
- [PilotConfig2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/PilotConfig2.java)
72-
- [DifferentialPilotStopTest](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/DifferentialPilotStopTest.java)
73-
- [DifferentialPilotTest1](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/DifferentialPilotTest1.java)
74-
- [DifferentialPilotTest9](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/DifferentialPilotTest9.java)
75-
- [MoveControllerTest1](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/MoveControllerTest1.java)
76-
- [MoveControllerTest2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/MoveControllerTest2.java)
77-
- [NavigatorTest1](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest1.java)
78-
- [NavigatorTest2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest2.java)
79-
- [NavigatorTest3](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest3.java)
80-
- [NavigatorTest4](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest4.java)
101+
- [PilotConfig2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/PilotConfig2.java)
102+
- [DifferentialPilotStopTest](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/DifferentialPilotStopTest.java)
103+
- [DifferentialPilotTest1](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/DifferentialPilotTest1.java)
104+
- [DifferentialPilotTest9](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/pilot/DifferentialPilotTest9.java)
105+
- [MoveControllerTest1](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/MoveControllerTest1.java)
106+
- [MoveControllerTest2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/MoveControllerTest2.java)
107+
- [NavigatorTest1](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest1.java)
108+
- [NavigatorTest2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest2.java)
109+
- [NavigatorTest3](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest3.java)
110+
- [NavigatorTest4](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/navigator/NavigatorTest4.java)
81111
- lejos.robotics.objectdetection
82-
- [FeatureAvoider](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/feature/FeatureAvoider.java)
83-
- [FeatureAvoider2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/feature/FeatureAvoider2.java)
84-
- [FeatureAvoider3](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/feature/FeatureAvoider3.java)
112+
- [FeatureAvoider](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/feature/FeatureAvoider.java)
113+
- [FeatureAvoider2](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/feature/FeatureAvoider2.java)
114+
- [FeatureAvoider3](https://github.com/ev3dev-lang-java/examples/blob/develop/ev3dev-lang-java/src/main/java/lejos/navigation/feature/FeatureAvoider3.java)
85115

86116

build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
//Gradle file library ev3dev-lang-java / examples
22
//Author: Juan Antonio Breña Moral
33

4-
allprojects {
4+
buildscript {
5+
repositories {
6+
jcenter()
7+
mavenCentral()
8+
maven {
9+
url "https://plugins.gradle.org/m2/"
10+
}
11+
maven { url "https://jitpack.io" }
12+
}
13+
dependencies {
14+
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
15+
classpath "com.github.ev3dev-lang-java:gradle-plugin:1.6.4"
16+
}
17+
}
18+
19+
subprojects {
520
version = "2.4.16"
621

722
repositories {
@@ -12,6 +27,9 @@ allprojects {
1227
apply plugin: 'java'
1328
apply plugin: 'eclipse'
1429
apply plugin: 'idea'
30+
apply plugin: 'com.github.ev3dev-lang-java.gradle-plugin'
31+
apply from: "${rootProject.projectDir}/config.gradle"
32+
apply from: "${project.projectDir}/config.gradle"
1533

1634
dependencies {
1735
compile("com.github.ev3dev-lang-java:ev3dev-lang-java:2.5.3")

config.gradle

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
import java.nio.file.Paths
12

2-
remotes {
3-
ev3dev {
4-
host = '10.0.1.3'
5-
user = 'robot'
6-
password = 'maker'
7-
}
3+
// Project configuration
4+
brick.pref {
5+
// Brick connection parameters //
6+
sshHost = "10.0.0.89"
7+
sshUser = "robot"
8+
sshPassword = "maker"
9+
10+
// Do not use stuff embedded in manifest (for easier main class changes)
11+
useEmbeddedPaths = false
12+
}
13+
14+
brick.paths {
15+
wrapperDir = "/home/robot/examples"
816
}

demo-2.4.16/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version = '0.1.0-SNAPSHOT'
12

23
dependencies {
34
//compile group: 'com.github.ev3dev-lang-java', name: 'ev3dev-lang-java', version: '2.4.16'
@@ -12,3 +13,13 @@ dependencies {
1213

1314

1415
}
16+
17+
jar {
18+
manifest {
19+
attributes("Implementation-Title": "EV3Dev-lang-java / Demos for 2.4.16",
20+
"Implementation-Version": project.version,
21+
"Implementation-Vendor": "Juan Antonio Breña Moral",
22+
"Main-Class": brick.pref.mainClass,
23+
"Class-Path": brick.getClassPath(true) )
24+
}
25+
}

demo-2.4.16/config.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Subproject configuration
2+
brick.pref {
3+
// Main class //
4+
mainClass = "examples.Demo"
5+
}

demo-2.4.16/src/main/resources/META-INF/MANIFEST.MF

Lines changed: 0 additions & 10 deletions
This file was deleted.

demo/build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
version = '0.1.0-SNAPSHOT'
12

23
dependencies {
3-
compile("com.github.ev3dev-lang-java:ev3dev-lang-java:0.7.0")
4-
compile("com.github.ev3dev-lang-java:RPLidar4J:v0.3.2-SNAPSHOT")
5-
compile group: 'javazoom', name: 'jlayer', version: '1.0.1'
4+
compile group: 'com.github.ev3dev-lang-java', name: 'ev3dev-lang-java', version: '0.7.0'
5+
compile group: 'com.github.ev3dev-lang-java', name: 'RPLidar4J', version: 'v0.3.2-SNAPSHOT'
6+
compile group: 'javazoom', name: 'jlayer', version: '1.0.1'
7+
}
68

9+
jar {
10+
manifest {
11+
attributes("Implementation-Title": "EV3Dev-lang-java / Demos for 0.7.0",
12+
"Implementation-Version": project.version,
13+
"Implementation-Vendor": "Juan Antonio Breña Moral",
14+
"Main-Class": brick.pref.mainClass,
15+
"Class-Path": brick.getClassPath(true) )
16+
}
717
}

demo/config.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Subproject configuration
2+
brick.pref {
3+
// Main class //
4+
mainClass = "examples.DemoStop"
5+
}

demo/src/main/resources/META-INF/MANIFEST.MF

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)