Skip to content

Commit

Permalink
Generate for JDK 17 or 11, depending on whether Lyo Version 6.x.x or
Browse files Browse the repository at this point in the history
below is chosen.
  • Loading branch information
Jad-el-khoury committed Oct 3, 2023
1 parent db07653 commit 5ddc73e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
- Introducing a user setting that allows one to view Shapes or Vocabularies terms in the Specification models.
- Creating a common library that defines the relation between domains and vocab.
- Introducing User Preferences through a Windows->Preferences page. Specifically, the current settings allow user to choose whether Domain Specifications should show Vocabulary or Shape terms.
- Generate for JDK 17 or 11, depending on whether Lyo Version 6.x.x or below is chosen.


### Changed
- generate the necessary maven dependencies for domain models that (a) are imported into the adaptor model yet (b) the adaptor is configured to not generate code from imported models. In such scenario, the maven dependency for the domain is necessary.
- generate the necessary maven dependencies for domain models that (a) are imported into the adaptor model yet (b) the adaptor is configured to not generate code from imported models. In such scenario, the maven dependency for the domain is necessary.
- `LYO_BASE` is replaced with `LYO_BASEURL`. To override the Base URL of the adaptor, use the `baseurl` property. This release makes the use of this property consistent and check the `LYO_BASEURL` environment variable instead of `LYO_BASE`.
- Upgraded the frontend libraries from Bootstrap v4.0.0-beta to v4.2.1.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
[import org::eclipse::lyo::oslc4j::codegenerator::services::domainSpecificationServices/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::vocabularyServices/]

[query public javaVersion(lyoVersion: String) : String =
(if (lyoVersion.first(1).toInteger() > 5) then
'17'
else
'11'
endif)
/]

[template private projectHeader(name : String, mavenProjectConfiguration : MavenProjectConfiguration, serverImplementation : Boolean)]
<modelVersion>4.0.0</modelVersion>
<!-- [protected ('header')]
Expand All @@ -40,9 +48,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>[javaVersion(mavenProjectConfiguration.lyoVersion)/]</maven.compiler.source>
<maven.compiler.target>[javaVersion(mavenProjectConfiguration.lyoVersion)/]</maven.compiler.target>
<maven.compiler.release>[javaVersion(mavenProjectConfiguration.lyoVersion)/]</maven.compiler.release>
<version.lyo>[mavenProjectConfiguration.lyoVersion/]</version.lyo>
<jersey.version>2.35</jersey.version>
[if (swaggerDocumentationEnabled)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<subModelOperations xsi:type="tool_1:SetValue" featureName="filesBasePath" valueExpression="[filesBasePath/]"/>
</subModelOperations>
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="adaptorinterface.MavenProjectConfiguration" referenceName="projectConfiguration" variableName="projectConfiguration">
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['5.1.1.Final'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['6.0.0-SNAPSHOT'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="groupId" valueExpression="[generalConfiguration.javaBasePackageName/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="artifactId" valueExpression="[adaptorInterface.name.toLower().replaceAll('\\W+', '-')/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="version" valueExpression="['0.0.1-SNAPSHOT'/]"/>
Expand Down Expand Up @@ -353,7 +353,7 @@
<subModelOperations xsi:type="tool_1:SetValue" featureName="filesBasePath" valueExpression="[filesBasePath/]"/>
</subModelOperations>
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="adaptorinterface.MavenProjectConfiguration" referenceName="projectConfiguration" variableName="projectConfiguration">
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['5.1.1.Final'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['6.0.0-SNAPSHOT'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="groupId" valueExpression="[generalConfiguration.javaBasePackageName/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="artifactId" valueExpression="[adaptorInterface.name.toLower().replaceAll('\\W+', '-')/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="version" valueExpression="['0.0.1-SNAPSHOT'/]"/>
Expand Down Expand Up @@ -1007,7 +1007,7 @@
<subModelOperations xsi:type="tool_1:SetValue" featureName="filesBasePath" valueExpression="[filesBasePath/]"/>
</subModelOperations>
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="adaptorinterface.MavenProjectConfiguration" referenceName="projectConfiguration" variableName="projectConfiguration">
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['5.1.1.Final'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['6.0.0-SNAPSHOT'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="groupId" valueExpression="[generalConfiguration.javaBasePackageName/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="artifactId" valueExpression="[adaptorInterface.name.toLower().replaceAll('\\W+', '-')/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="version" valueExpression="['0.0.1-SNAPSHOT'/]"/>
Expand Down Expand Up @@ -1936,7 +1936,7 @@
<subModelOperations xsi:type="tool_1:SetValue" featureName="doNotGenerate" valueExpression="[doNotGenerate/]"/>
</subModelOperations>
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="adaptorinterface.MavenProjectConfiguration" referenceName="projectConfiguration" variableName="projectConfiguration">
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['5.1.1.Final'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="lyoVersion" valueExpression="['6.0.0-SNAPSHOT'/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="artifactId" valueExpression="[if (container.oclIsTypeOf(DomainSpecification)) then container.oclAsType(DomainSpecification).name.toLower().replaceAll('\\W+', '-') else 'oslc-specification' endif/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="groupId" valueExpression="[if (not projectConfiguration.isNullOrEmpty(generalConfiguration.javaBasePackageName)) then generalConfiguration.javaBasePackageName else projectConfiguration.artifactId endif/]"/>
<subModelOperations xsi:type="tool_1:SetValue" featureName="version" valueExpression="['0.0.1-SNAPSHOT'/]"/>
Expand Down

0 comments on commit 5ddc73e

Please sign in to comment.