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 #2949 from florianpirchner/issue_2945
issue 2945 - add "writeStorageResources" to xtext-maven-plugin
- Loading branch information
Showing
8 changed files
with
125 additions
and
7 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
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
40 changes: 40 additions & 0 deletions
40
...t.maven.plugin/src/test/resources/it/generate/simple-lang-write-storage-resources/pom.xml
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,40 @@ | ||
<?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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>xtext-maven-plugin-it</artifactId> | ||
<version>IT-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>simple-lang-write-storage-resources</artifactId> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>xtext-maven-plugin</artifactId> | ||
<configuration> | ||
<languages> | ||
<language> | ||
<javaSupport>false</javaSupport> | ||
<setup>org.eclipse.xtext.testlanguages.noJdt.writeStorageResources.NoJdtTestLanguageWriteStoragResourcesStandaloneSetup</setup> | ||
</language> | ||
</languages> | ||
<writeStorageResources>true</writeStorageResources> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>org.eclipse.xtext.testlanguages</artifactId> | ||
<version>${xtext-version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
1 change: 1 addition & 0 deletions
1
.../test/resources/it/generate/simple-lang-write-storage-resources/src/main/java/Model.nojdt
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 @@ | ||
Hello maven! |
1 change: 1 addition & 0 deletions
1
...st/resources/it/generate/simple-lang-write-storage-resources/src/main/java/RefModel.nojdt
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 @@ | ||
Hello Test (from maven)! |
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
18 changes: 18 additions & 0 deletions
18
...ges/noJdt/writeStorageResources/NoJdtTestLanguageWriteStoragResourcesStandaloneSetup.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,18 @@ | ||
package org.eclipse.xtext.testlanguages.noJdt.writeStorageResources; | ||
|
||
import org.eclipse.xtext.testlanguages.noJdt.NoJdtTestLanguageStandaloneSetupGenerated; | ||
|
||
import com.google.inject.Guice; | ||
import com.google.inject.Injector; | ||
|
||
/** | ||
* Initialization support for running Xtext languages | ||
* without equinox extension registry | ||
*/ | ||
public class NoJdtTestLanguageWriteStoragResourcesStandaloneSetup extends NoJdtTestLanguageStandaloneSetupGenerated{ | ||
|
||
public Injector createInjector() { | ||
return Guice.createInjector(new NoJdtTestLanguageWriteStorageResourcesRuntimeModule()); | ||
} | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
...ages/noJdt/writeStorageResources/NoJdtTestLanguageWriteStorageResourcesRuntimeModule.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,29 @@ | ||
package org.eclipse.xtext.testlanguages.noJdt.writeStorageResources; | ||
|
||
import org.eclipse.xtext.generator.AbstractFileSystemAccess2; | ||
import org.eclipse.xtext.generator.JavaIoFileSystemAccess; | ||
import org.eclipse.xtext.resource.XtextResource; | ||
import org.eclipse.xtext.resource.persistence.IResourceStorageFacade; | ||
import org.eclipse.xtext.resource.persistence.ResourceStorageFacade; | ||
import org.eclipse.xtext.resource.persistence.StorageAwareResource; | ||
|
||
/** | ||
* Use this class to register components to be used at runtime / without the | ||
* Equinox extension registry. | ||
*/ | ||
public class NoJdtTestLanguageWriteStorageResourcesRuntimeModule | ||
extends org.eclipse.xtext.testlanguages.noJdt.AbstractNoJdtTestLanguageRuntimeModule { | ||
|
||
public Class<? extends IResourceStorageFacade> bindIResourceStorageFacade() { | ||
return ResourceStorageFacade.class; | ||
} | ||
|
||
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() { | ||
return JavaIoFileSystemAccess.class; | ||
} | ||
|
||
@Override | ||
public Class<? extends XtextResource> bindXtextResource() { | ||
return StorageAwareResource.class; | ||
} | ||
} |