-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from LorenzoBettini/jbasescript-example
Jbasescript example
- Loading branch information
Showing
10 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="src-gen"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>jbase.example.jbasescript.example.project</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<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> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
</natures> | ||
</projectDescription> |
8 changes: 8 additions & 0 deletions
8
jbase.example.jbasescript.example.project/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=1.8 |
8 changes: 8 additions & 0 deletions
8
jbase.example.jbasescript.example.project/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Lorenzo Bettini | ||
Bundle-SymbolicName: jbase.example.jbasescript.example.project | ||
Bundle-Version: 0.11.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Require-Bundle: org.eclipse.xtext.xbase.lib;bundle-version="2.13.0" | ||
Automatic-Module-Name: jbase.example.jbasescript.example.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/,\ | ||
src-gen/ | ||
bin.includes = META-INF/,\ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<relativePath>../jbase.parent/pom.xml</relativePath> | ||
<groupId>net.sf.xtext-jbase</groupId> | ||
<artifactId>jbase.parent</artifactId> | ||
<version>0.11.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jbase.example.jbasescript.example.project</artifactId> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>xtext-maven-plugin</artifactId> | ||
<version>${xtext-version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<languages> | ||
<language> | ||
<setup>jbase.example.jbasescript.JbasescriptStandaloneSetup</setup> | ||
<outputConfigurations> | ||
<outputConfiguration> | ||
<outputDirectory>src-gen</outputDirectory> | ||
</outputConfiguration> | ||
</outputConfigurations> | ||
</language> | ||
</languages> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<groupId>net.sf.xtext-jbase</groupId> | ||
<artifactId>jbase.example.jbasescript</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>net.sf.xtext-jbase</groupId> | ||
<artifactId>jbase</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
42 changes: 42 additions & 0 deletions
42
jbase.example.jbasescript.example.project/src-gen/jbasescript/Example.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package jbasescript; | ||
|
||
import java.io.File; | ||
import jbase.example.jbasescript.example.project.ExampleHelper; | ||
|
||
@SuppressWarnings("all") | ||
public class Example { | ||
public static void printFileNames(String path) { | ||
File folder = new File(path); | ||
File[] listOfFiles = folder.listFiles(); | ||
ExampleHelper helper = new ExampleHelper(); | ||
for (int i = 0; (i < listOfFiles.length); i++) { | ||
boolean _isFile = listOfFiles[i].isFile(); | ||
if (_isFile) { | ||
String _aFile = helper.aFile(); | ||
String _name = listOfFiles[i].getName(); | ||
String _plus = (_aFile + _name); | ||
System.out.println(_plus); | ||
} else { | ||
boolean _isDirectory = listOfFiles[i].isDirectory(); | ||
if (_isDirectory) { | ||
String _aDir = helper.aDir(); | ||
String _name_1 = listOfFiles[i].getName(); | ||
String _plus_1 = (_aDir + _name_1); | ||
System.out.println(_plus_1); | ||
} | ||
} | ||
} | ||
} | ||
|
||
public static void main(String[] args) throws Throwable { | ||
int _length = args.length; | ||
boolean _greaterThan = (_length > 0); | ||
if (_greaterThan) { | ||
for (int i = 0; (i < args.length); ++i) { | ||
Example.printFileNames(args[i]); | ||
} | ||
} else { | ||
Example.printFileNames("."); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
jbase.example.jbasescript.example.project/src/Example.jbasescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import java.io.File; | ||
import jbase.example.jbasescript.example.project.ExampleHelper; | ||
|
||
op printFileNames(String path) { | ||
File folder = new File(path); | ||
File[] listOfFiles = folder.listFiles(); | ||
ExampleHelper helper = new ExampleHelper(); | ||
|
||
for (int i = 0; i < listOfFiles.length; i++) { | ||
if (listOfFiles[i].isFile()) { | ||
System.out.println(helper.aFile() + listOfFiles[i].getName()); | ||
} else if (listOfFiles[i].isDirectory()) { | ||
System.out.println(helper.aDir() + listOfFiles[i].getName()); | ||
} | ||
} | ||
} | ||
|
||
if (args.length > 0) { | ||
for (int i = 0; i < args.length; ++i) | ||
printFileNames(args[i]); | ||
} else { | ||
printFileNames("."); | ||
} |
12 changes: 12 additions & 0 deletions
12
...sescript.example.project/src/jbase/example/jbasescript/example/project/ExampleHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package jbase.example.jbasescript.example.project; | ||
|
||
public class ExampleHelper { | ||
|
||
public String aFile() { | ||
return "File: "; | ||
} | ||
|
||
public String aDir() { | ||
return "Directory: "; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters