8000 Improving the guide to use Template Project · ev3dev-lang-java/docs@027b81e · GitHub
[go: up one dir, main page]

Skip to content

Commit 027b81e

Browse files
committed
Improving the guide to use Template Project
1 parent 5139dee commit 027b81e

File tree

3 files changed

+68
-12
lines changed

3 files changed

+68
-12
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Manifest-Version: 1.0
2+
Implementation-Title: EV3Dev-lang-java // Template project
3+
Implementation-Version: 0.3.0
4+
Implementation-Vendor: YOUR NAME
5+
Main-Class: HelloWorld
6+
7+
8+
Loading

src/main/asciidoc/getting_started/create-your-first-project.adoc

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,40 @@
22

33
## Introduction
44

5-
Create your first project is not complicated, the project provides a `Template project`
6-
using `Gradle` but you could create a new project from Scratch too.
5+
Create your first project is not complicated but the process requires time and this is the reason to
6+
develop a `Template project` using `Gradle`.
77

88
The advantages of the usage of the Template project are:
99

1010
* Build System configured
1111
* Dependencies defined
12-
* Tasks defined for the interaction with the Brick
12+
* Tasks defined to interact with the Brick
13+
14+
WARNING: If you installed Debian Jessie on your Brick, use the branch Master of the repository
15+
link:https://github.com/ev3dev-lang-java/template_project_gradle/[https://github.com/ev3dev-lang-java/template_project_gradle/]
16+
but if you installed Debian Stretch on your Brick, use the branch develop of the repository
17+
link:https://github.com/ev3dev-lang-java/template_project_gradle/tree/develop[https://github.com/ev3dev-lang-java/template_project_gradle/tree/develop]
1318

1419
## Create your first project using the Gradle template project
1520

16-
The project provide a Gradle template project ready to run in your favourite Java IDE like IntelliJ or Eclipse.
21+
WARNING: The whole guide is designed for Debian Jessie
22+
23+
### Clone/Download the project in your computer
1724

18-
Visit this link:https://github.com/ev3dev-lang-java/template_project_gradle[Git repository] to download the template project:
25+
The project `Template project` is hosted on Github and it possible to download the content of a Git branch or
26+
execute the following statement to clone the project in local.
1927

2028
```
2129
git clone https://github.com/ev3dev-lang-java/template_project_gradle.git
2230
```
2331

24-
Once you have downloaded the project in your personal computer,
25-
open the project with your Java IDE to edit the file: `config.gradle`: to update IP of you Brick:
32+
Now you have you have in local the project.
33+
Open the project with your favourite Java IDE.
2634

35+
### Configure the Brick IP
36+
37+
In the project opened, open the file: `config.gradle`: to update IP of you Brick connected to the network
38+
where your computer is connected:
2739

2840
```
2941
remotes {
@@ -35,24 +47,60 @@ remotes {
3547
}
3648
```
3749

38-
to check that the java IDE connect with the brick, execute the following Gradle task:
50+
to check that the Java IDE connects with the Brick, execute the following Gradle task:
3951

4052
```
4153
./gradlew testConnection
4254
```
4355

44-
The project are configured to send to the Brick the following example:
56+
If the execution of the task was successfully then your computer has a direct connection with your Brick.
57+
58+
### Deploy the default program
59+
60+
The template project includes a Default program named `MyFirstRobot.java`.
61+
The example was designed to move a Mobile Robot with 2 motors connected to Port A & Port B.
62+
If you need inspiration to create your Physical robot, `LEGO Education` provides some excellent
63+
link:https://education.lego.com/en-us/support/mindstorms-ev3/building-instructions[Building Instructions Guides]
64+
65+
image:baseRobot.png[Base Robot]
66+
67+
Follow the link:https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-driving-base-79bebfc16bd491186ea9c9069842155e.pdf[link] to build the Base Robot.
68+
69+
70+
*MyFirstRobot.java*
4571

4672
[source,java]
4773
----
4874
include::MyFirstRobot.java[]
4975
----
5076

51-
The example was designed to move a mobile robot with 2 motors connected to Port A & Port B.
77+
To deploy the example on your brick, open a `terminal` and type:
78+
79+
```
80+
./gradlew deployAndRun
81+
```
82+
83+
### Add your new program
84+
85+
Once you feel comfortable with the Template project and the Gradle Tasks, you could feel the need to add your
86+
own program. In this case, add in the project the new Java file like this one:
87+
88+
*HelloWorld.java*
89+
90+
[source,java]
91+
----
92+
include::HelloWorld.java[]
93+
----
94+
95+
In order to run the new program, you will have to open the file MANIFEST.MF and update the field about `Main-Class`
96+
indicating the new class, in this case `HelloWorld`
5297

53-
### Deploy your program
98+
[source,java]
99+
----
100+
include::MANIFEST.MF[]
101+
----
54102

55-
To deploy the example on your brick, open a `terminal` and type:
103+
To deploy the new example on your brick, open a `terminal` and type:
56104

57105
```
58106
./gradlew deployAndRun

0 commit comments

Comments
 (0)
0