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 #5414 from DataInMotion/fix_regenerate
skips generation if nothing has changed
- Loading branch information
Showing
36 changed files
with
1,862 additions
and
8 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
5 changes: 5 additions & 0 deletions
5
maven/bnd-generate-maven-plugin/src/it/generate-no-rerun/bnd.bnd
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,5 @@ | ||
-generate:\ | ||
src/main/resources/model/test.genmodel;\ | ||
generate="geckoEMF 1>out.log 2>out.log";\ | ||
genmodel="src/main/resources/model/test.genmodel";\ | ||
output=src/main/java |
7 changes: 7 additions & 0 deletions
7
maven/bnd-generate-maven-plugin/src/it/generate-no-rerun/invoker.properties
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,7 @@ | ||
invoker.goals=--no-transfer-progress package | ||
|
||
# Run mvn with --debug for debug logging | ||
#invoker.debug=true | ||
|
||
# Run mvn in debugging mode and wait for a debugger to attach | ||
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 |
46 changes: 46 additions & 0 deletions
46
maven/bnd-generate-maven-plugin/src/it/generate-no-rerun/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,46 @@ | ||
<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> | ||
|
||
|
||
<groupId>biz.aQute.bnd-test</groupId> | ||
<artifactId>generate</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.geckoprojects.emf</groupId> | ||
<artifactId>org.gecko.emf.osgi.api</artifactId> | ||
<version>4.1.1.202202162308</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-generate-maven-plugin</artifactId> | ||
<version>${bnd.version}</version> | ||
<configuration> | ||
<externalPlugins> | ||
<dependency> | ||
<groupId>org.geckoprojects.emf</groupId> | ||
<artifactId>org.gecko.emf.osgi.codegen</artifactId> | ||
<version>4.1.1.202202162308</version> | ||
</dependency> | ||
</externalPlugins> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>bnd-generate</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
23 changes: 23 additions & 0 deletions
23
maven/bnd-generate-maven-plugin/src/it/generate-no-rerun/postbuild.groovy
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 aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.bnd.version.MavenVersion | ||
import aQute.lib.io.IO | ||
|
||
import java.util.jar.Attributes | ||
import java.util.jar.JarFile; | ||
|
||
def baseVersion = new MavenVersion(bndVersion).toReleaseVersion() | ||
|
||
// Check the ecore file exist! | ||
File ecore = new File(basedir,"src/main/resources/model/test.ecore") | ||
assert ecore.isFile() | ||
|
||
// Check the genmodel file exist! | ||
File genmodel = new File(basedir,"src/main/resources/model/test.genmodel") | ||
assert genmodel.isFile() | ||
|
||
// Check the if some code generated file exist! | ||
File testClass = new File(basedir,"src/main/java/aQute/bnd/maven/model/test/TestShouldNotBeDeleted.java") | ||
assert testClass.isFile() |
30 changes: 30 additions & 0 deletions
30
maven/bnd-generate-maven-plugin/src/it/generate-no-rerun/prebuild.groovy
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,30 @@ | ||
import aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.bnd.version.MavenVersion | ||
import aQute.lib.io.IO | ||
|
||
import java.util.jar.Attributes | ||
import java.util.jar.JarFile; | ||
|
||
def baseVersion = new MavenVersion(bndVersion).toReleaseVersion() | ||
|
||
// Check the ecore file exist! | ||
File ecore = new File(basedir,"src/main/resources/model/test.ecore") | ||
assert ecore.isFile() | ||
|
||
// Check the genmodel file exist! | ||
File genmodel = new File(basedir,"src/main/resources/model/test.genmodel") | ||
assert genmodel.isFile() | ||
|
||
// Check the pomfile exist! | ||
File pom = new File(basedir,"pom.xml") | ||
assert pom.isFile() | ||
|
||
// Check the if some code generated file exist! | ||
File testClass = new File(basedir,"src/main/java/aQute/bnd/maven/model/test/TestShouldNotBeDeleted.java") | ||
assert testClass.isFile() | ||
|
||
genmodel.setLastModified(testClass.lastModified() - 10000L); | ||
pom.setLastModified(testClass.lastModified() - 10000L); |
18 changes: 18 additions & 0 deletions
18
...-maven-plugin/src/it/generate-no-rerun/src/main/java/aQute/bnd/maven/model/test/Test.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 aQute.bnd.maven.model.test; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* A representation of the model object '<em><b>Test</b></em>'. | ||
* <!-- end-user-doc --> | ||
* | ||
* | ||
* @see aQute.bnd.maven.model.test.TestPackage#getTest() | ||
* @model | ||
* @generated | ||
*/ | ||
public interface Test extends EObject { | ||
} // Test |
42 changes: 42 additions & 0 deletions
42
...plugin/src/it/generate-no-rerun/src/main/java/aQute/bnd/maven/model/test/TestFactory.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 aQute.bnd.maven.model.test; | ||
|
||
import org.eclipse.emf.ecore.EFactory; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* The <b>Factory</b> for the model. | ||
* It provides a create method for each non-abstract class of the model. | ||
* <!-- end-user-doc --> | ||
* @see aQute.bnd.maven.model.test.TestPackage | ||
* @generated | ||
*/ | ||
public interface TestFactory extends EFactory { | ||
/** | ||
* The singleton instance of the factory. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
TestFactory eINSTANCE = aQute.bnd.maven.model.test.impl.TestFactoryImpl.init(); | ||
|
||
/** | ||
* Returns a new object of class '<em>Test</em>'. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @return a new object of class '<em>Test</em>'. | ||
* @generated | ||
*/ | ||
Test createTest(); | ||
|
||
/** | ||
* Returns the package supported by this factory. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @return the package supported by this factory. | ||
* @generated | ||
*/ | ||
TestPackage getTestPackage(); | ||
|
||
} //TestFactory |
105 changes: 105 additions & 0 deletions
105
...plugin/src/it/generate-no-rerun/src/main/java/aQute/bnd/maven/model/test/TestPackage.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,105 @@ | ||
/** | ||
*/ | ||
package aQute.bnd.maven.model.test; | ||
|
||
import org.eclipse.emf.ecore.EClass; | ||
import org.eclipse.emf.ecore.EPackage; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* The <b>Package</b> for the model. | ||
* It contains accessors for the meta objects to represent | ||
* <ul> | ||
* <li>each class,</li> | ||
* <li>each feature of each class,</li> | ||
* <li>each operation of each class,</li> | ||
* <li>each enum,</li> | ||
* <li>and each data type</li> | ||
* </ul> | ||
* <!-- end-user-doc --> | ||
* @see aQute.bnd.maven.model.test.TestFactory | ||
* @model kind="package" | ||
* @generated | ||
*/ | ||
public interface TestPackage extends EPackage { | ||
/** | ||
* The package name. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
String eNAME = "test"; | ||
|
||
/** | ||
* The package namespace URI. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
String eNS_URI = "https://bndtools.org/model/test/1.0"; | ||
|
||
/** | ||
* The package namespace name. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
String eNS_PREFIX = "test"; | ||
|
||
/** | ||
* The singleton instance of the package. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
TestPackage eINSTANCE = aQute.bnd.maven.model.test.impl.TestPackageImpl.init(); | ||
|
||
/** | ||
* The meta object id for the '{@link aQute.bnd.maven.model.test.impl.TestImpl <em>Test</em>}' class. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see aQute.bnd.maven.model.test.impl.TestImpl | ||
* @see aQute.bnd.maven.model.test.impl.TestPackageImpl#getTest() | ||
* @generated | ||
*/ | ||
int TEST = 0; | ||
|
||
/** | ||
* The number of structural features of the '<em>Test</em>' class. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
* @ordered | ||
*/ | ||
int TEST_FEATURE_COUNT = 0; | ||
|
||
/** | ||
* The number of operations of the '<em>Test</em>' class. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
* @ordered | ||
*/ | ||
int TEST_OPERATION_COUNT = 0; | ||
|
||
|
||
/** | ||
* Returns the meta object for class '{@link aQute.bnd.maven.model.test.Test <em>Test</em>}'. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @return the meta object for class '<em>Test</em>'. | ||
* @see aQute.bnd.maven.model.test.Test | ||
* @generated | ||
*/ | ||
EClass getTest(); | ||
|
||
/** | ||
* Returns the factory that creates the instances of the model. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @return the factory that creates the instances of the model. | ||
* @generated | ||
*/ | ||
TestFactory getTestFactory(); | ||
|
||
} //TestPackage |
18 changes: 18 additions & 0 deletions
18
...it/generate-no-rerun/src/main/java/aQute/bnd/maven/model/test/TestShouldNotBeDeleted.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 aQute.bnd.maven.model.test; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* A representation of the model object '<em><b>Test</b></em>'. | ||
* <!-- end-user-doc --> | ||
* | ||
* | ||
* @see aQute.bnd.maven.model.test.TestPackage#getTest() | ||
* @model | ||
* @generated | ||
*/ | ||
public interface TestShouldNotBeDeleted extends EObject { | ||
} // Test |
Oops, something went wrong.