Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add support for Visual Studio Code #4573

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b92793d
Add .classpath and .project files
mattdibi Apr 8, 2023
1169c42
fix: classpath
mattdibi Apr 8, 2023
d180523
test: fixed most of classpaths
mattdibi Apr 8, 2023
3fdb646
fix: classpath for core component
mattdibi Apr 8, 2023
7d18ba3
fix: complete fix classpath of test
mattdibi Apr 8, 2023
9da9741
fix: emulator classpath
mattdibi Apr 8, 2023
b7aa8c5
fix: ai.triton.test
mattdibi Apr 8, 2023
67aad7f
fix: relative path for target platform
mattdibi Apr 9, 2023
7976a2b
Revert "fix: relative path for target platform"
mattdibi Apr 9, 2023
0447986
feat: add javaConfig.json file
mattdibi Apr 9, 2023
8b9a2db
feat: add devcontainer.json
mattdibi Apr 9, 2023
6987580
feat: add extensions, set workspace folder
mattdibi Apr 9, 2023
8f61dc8
feat: add build command
mattdibi Apr 9, 2023
0241bcd
feat: refert to container root
mattdibi Apr 9, 2023
fedbfca
Update devcontainer.json
mattdibi Apr 9, 2023
5aa5d26
fix: kura-equinox_3.16.0.target devenvironment path
mattdibi Apr 9, 2023
2364e99
feat: postCreateCommand
mattdibi Apr 9, 2023
ace39d0
feat: comment out postCreateCommand (time consuming)
mattdibi Apr 10, 2023
da65c37
feat: update project/classpath files
mattdibi Apr 10, 2023
cabfcbd
Minor devcontainer.json optimizations
mattdibi Apr 10, 2023
27d8e60
chore: update .gitignore for tycho stuff
mattdibi Apr 10, 2023
17e8b23
style: formatting .json file
mattdibi Apr 13, 2023
7729a38
fix: use relative paths for target-definition
mattdibi Apr 15, 2023
3409270
fix: improve upon previous TP paths
mattdibi Apr 15, 2023
807aeb3
chore: remove unnecessary .project file
mattdibi Apr 16, 2023
23836f7
chore: ignore .classpath/.project files in target-platform folder
mattdibi Apr 16, 2023
4a55d82
chore: remove .devcontainer configuration
mattdibi Apr 16, 2023
c2aff10
feat: add recommended extensions for this workspace
mattdibi Apr 16, 2023
edff8e7
feat: add formatter settings
mattdibi Apr 16, 2023
f3368e6
feat: added missing tests
mattdibi Apr 16, 2023
75dae26
fix: build paths
mattdibi Apr 16, 2023
7e663bd
chore: import in vscode
mattdibi Apr 16, 2023
b4d4864
fix: sensehat test build
mattdibi Apr 16, 2023
00d16fe
fix: classpath for util.wire.test and kura.test
mattdibi Apr 16, 2023
1d1b31f
fix: missing jars in driver.opcua.test
mattdibi Apr 16, 2023
91eef6d
fix: added missing project in javaConfig.json file
mattdibi Apr 16, 2023
53408be
docs(README): Add VSCode setup instructions
mattdibi Apr 17, 2023
701f319
docs: fix Eclipse IDE setup link url
mattdibi Apr 17, 2023
f64c874
feat: add Kura remote debug configuration
mattdibi May 6, 2023
1c1a3b9
feat: add projectName selector for debugging
mattdibi May 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
*~
classes
target
.classpath
.project
.wtpmodules
.settings
.sonar
Expand Down Expand Up @@ -38,3 +36,4 @@ bin/
maven.deps
DEPENDENCIES
.java-version
.tycho-consumer-pom.xml
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,8 @@ Development on Kura follows a [variant of the gitflow model](https://github.com/
Getting Started
-----------------

Development for Kura can be done in Eclipse IDE using the Kura Development Environment, in a gateway or in a Docker container.

## Development Environment

### Supported Development Platforms
The Eclipse Installer based setup works for the main used platforms like Linux, Mac OS and Windows.

### Prerequisites
Before installing Kura, you need to have the following programs installed in your system
* JDK 1.8
Expand Down Expand Up @@ -155,28 +150,22 @@ mvn -f kura/distrib/pom.xml clean install -DbuildAllContainers

After this command runs, images can be found in your preferred container engine image list.

### Eclipse IDE
The simplest way to start developing on Eclipse Kura is to use an [Eclipse Installer](https://www.eclipse.org/downloads/) based setup. A detailed installation and setup guide is available on the [official documentation](http://eclipse.github.io/kura/dev/kura-setup.html). Here you'll find a brief explaination of the required steps.
### Visual Studio Code

The simplest way to start developing on Eclipse Kura is to use a [Visual Studio Code](https://code.visualstudio.com/docs/languages/java) based setup.

To correctly setup the environment, proceed as follows:
- Install a jdk-8 distribution like [Eclipse Temurin](https://adoptium.net/temurin/releases/?version=8) for your specific CPU architecture and OS.
- Start the Eclipse Installer
- Switch to advanced mode (top right hamburger menu > Advanced Mode)
- Select "Eclipse IDE for Eclipse Committers" and configure the "Product Version" to be the version **2022-06 or older**.
- Set the Java 1.8+ VM to the installed local jdk-8 VM, and press the Next button
- Select the Eclipse Kura installer from the list. If this is not available, add a new installer from https://raw.githubusercontent.com/eclipse/kura/develop/kura/setups/kura.setup, then check and press the Next button
- Select the "Developer Type":
- "User": if you want to develop applications or bundles running on Kura, select this option. It will install only the APIs and the examples.
- "Developer" : if you are a framework developer, select this option. It will download and configure the Eclipse Kura framework.
- Update Eclipse Kura Git repository username and customize further settings if you like (e.g. Root install folder, Installation folder name). To show these options, make sure that the "Show all variables" checkbox is enabled
- Leave all Bootstrap Tasks selected and press the Finish button
- Accept all the licenses and wait for the installation to finish
At first startup Eclipse IDE will checkout the code, perform a full build and configure a few Working Sets.
- When the tasks are completed. In the IDE open (double click) Target Platform > Target-Definition > Kura Target Platform Equinox 3.16.0, and press "Set as Target Platform" located at the top right of the window
- Open Visual Studio Code in the `kura` directory.
- Install the recommended extensions.
- Load the project in [Standard Mode](https://code.visualstudio.com/docs/java/java-project#_lightweight-mode).
- After the build completes you'll see a lot of errors. This is normal. To fix this run the _"Developer: Reload Window"_ command in the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette)(this is needed only once, the first time you import the project).
- ... and you're done!

Now you are ready to develop on Eclipse Kura.

To raise an issue, please report a bug on [GitHub issues](https://github.com/eclipse/kura/issues/new).
### Eclipse IDE

If you prefer a more advanced setup you can follow the setup instructions for [Eclipse IDE](https://eclipse.github.io/kura/latest/java-application-development/development-environment-setup/).

### Known Issues
Currently, the emulator web ui is not properly working on Windows so, with your setup, you will be able to build and deploy you applications, but not be able to use the Eclipse IDE based Kura emulator.
Expand Down
28 changes: 28 additions & 0 deletions kura/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>kura</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1681116377785</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
17 changes: 17 additions & 0 deletions kura/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"redhat.java",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-dependency",
"vscjava.vscode-java-pack",
"vscjava.vscode-java-test",
"vscjava.vscode-maven",
"sonarsource.sonarlint-vscode",
"yaozheng.vscode-pde"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
125 changes: 125 additions & 0 deletions kura/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Remote Kura debug",
"request": "attach",
"hostName": "${input:ipAddress}",
"projectName": "${input:bundleProject}",
"port": 8000
}
],
"inputs": [
{
"id": "ipAddress",
"type": "promptString",
"description": "IP Address of the device running Kura"
},
{
"id": "bundleProject",
"type": "pickString",
"description": "Select the bundle project to be debugged",
"options":[
"org.eclipse.kura.ai.triton.server",
"org.eclipse.kura.api",
"org.eclipse.kura.asset.cloudlet.provider",
"org.eclipse.kura.asset.helper.provider",
"org.eclipse.kura.asset.provider",
"org.eclipse.kura.ble.eddystone.provider",
"org.eclipse.kura.ble.ibeacon.provider",
"org.eclipse.kura.ble.provider",
"org.eclipse.kura.broker.artemis.core",
"org.eclipse.kura.broker.artemis.simple.mqtt",
"org.eclipse.kura.broker.artemis.xml",
"org.eclipse.kura.camel",
"org.eclipse.kura.camel.cloud.factory",
"org.eclipse.kura.camel.xml",
"org.eclipse.kura.cloudconnection.eclipseiot.mqtt.provider",
"org.eclipse.kura.cloudconnection.raw.mqtt.provider",
"org.eclipse.kura.configuration.change.manager",
"org.eclipse.kura.container.orchestration.provider",
"org.eclipse.kura.container.provider",
"org.eclipse.kura.core",
"org.eclipse.kura.core.certificates",
"org.eclipse.kura.core.cloud",
"org.eclipse.kura.core.cloud.factory",
"org.eclipse.kura.core.comm",
"org.eclipse.kura.core.configuration",
"org.eclipse.kura.core.crypto",
"org.eclipse.kura.core.deployment",
"org.eclipse.kura.core.inventory",
"org.eclipse.kura.core.keystore",
"org.eclipse.kura.core.net",
"org.eclipse.kura.core.status",
"org.eclipse.kura.core.system",
"org.eclipse.kura.core.tamper.detection",
"org.eclipse.kura.db.sqlite.provider",
"org.eclipse.kura.deployment.agent",
"org.eclipse.kura.docs",
"org.eclipse.kura.driver.ble.sensortag.provider",
"org.eclipse.kura.driver.ble.xdk",
"org.eclipse.kura.driver.block",
"org.eclipse.kura.driver.eddystone.provider",
"org.eclipse.kura.driver.gpio.provider",
"org.eclipse.kura.driver.helper.provider",
"org.eclipse.kura.driver.ibeacon.provider",
"org.eclipse.kura.driver.opcua.provider",
"org.eclipse.kura.driver.s7plc.provider",
"org.eclipse.kura.event.publisher",
"org.eclipse.kura.hook.file.move.provider",
"org.eclipse.kura.http.server.manager",
"org.eclipse.kura.json.marshaller.unmarshaller.provider",
"org.eclipse.kura.linux.bluetooth",
"org.eclipse.kura.linux.clock",
"org.eclipse.kura.linux.command",
"org.eclipse.kura.linux.debian.provider",
"org.eclipse.kura.linux.gpio",
"org.eclipse.kura.linux.net",
"org.eclipse.kura.linux.position",
"org.eclipse.kura.linux.redhat.provider",
"org.eclipse.kura.linux.systemd.provider",
"org.eclipse.kura.linux.sysv.provider",
"org.eclipse.kura.linux.usb",
"org.eclipse.kura.linux.usb.aarch64",
"org.eclipse.kura.linux.usb.armv6hf",
"org.eclipse.kura.linux.usb.x86_64",
"org.eclipse.kura.linux.watchdog",
"org.eclipse.kura.localization",
"org.eclipse.kura.localization.resources",
"org.eclipse.kura.log.filesystem.provider",
"org.eclipse.kura.misc.cloudcat",
"org.eclipse.kura.net.admin",
"org.eclipse.kura.net.admin.firewall",
"org.eclipse.kura.net.configuration",
"org.eclipse.kura.network.threat.manager",
"org.eclipse.kura.nm",
"org.eclipse.kura.protocol.can",
"org.eclipse.kura.protocol.modbus",
"org.eclipse.kura.request.handler.jaxrs",
"org.eclipse.kura.rest.asset.provider",
"org.eclipse.kura.rest.configuration.provider",
"org.eclipse.kura.rest.network.status.provider",
"org.eclipse.kura.rest.provider",
"org.eclipse.kura.rest.wire.provider",
"org.eclipse.kura.stress",
"org.eclipse.kura.useradmin.store",
"org.eclipse.kura.util",
"org.eclipse.kura.web2",
"org.eclipse.kura.web2.ext",
"org.eclipse.kura.wire.ai.component.provider",
"org.eclipse.kura.wire.camel",
"org.eclipse.kura.wire.component.conditional.provider",
"org.eclipse.kura.wire.component.join.provider",
"org.eclipse.kura.wire.component.provider",
"org.eclipse.kura.wire.db.component.provider",
"org.eclipse.kura.wire.h2db.component.provider",
"org.eclipse.kura.wire.helper.provider",
"org.eclipse.kura.wire.provider",
"org.eclipse.kura.wire.script.filter.provider",
"org.eclipse.kura.wire.script.tools",
"org.eclipse.kura.xml.marshaller.unmarshaller.provider"
]
}
]
}
5 changes: 5 additions & 0 deletions kura/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"java.format.settings.url": "setups/formatting/KuraFormatter.xml",
"editor.defaultFormatter": "redhat.java",
"editor.formatOnSave": true
}
28 changes: 28 additions & 0 deletions kura/emulator/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>emulator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1681116377782</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
7 changes: 7 additions & 0 deletions kura/emulator/org.eclipse.kura.emulator.clock/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
45 changes: 45 additions & 0 deletions kura/emulator/org.eclipse.kura.emulator.clock/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.kura.emulator.clock</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1681116377988</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
7 changes: 7 additions & 0 deletions kura/emulator/org.eclipse.kura.emulator.gpio/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
45 changes: 45 additions & 0 deletions kura/emulator/org.eclipse.kura.emulator.gpio/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.kura.emulator.gpio</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1681116377990</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
7 changes: 7 additions & 0 deletions kura/emulator/org.eclipse.kura.emulator.net/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Loading