Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TOP IDE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDL Open Source
TOP IDE
Commits
2b9345a9
Commit
2b9345a9
authored
7 months ago
by
Martti Käärik
Browse files
Options
Downloads
Patches
Plain Diff
Updated OpenAPI project wizard to include more libraries and removed redundant settings.
parent
03dec706
No related branches found
No related tags found
No related merge requests found
Pipeline
#9359
passed
7 months ago
Stage: build
Stage: prepare
Stage: upload
Stage: release
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend
+32
-22
32 additions, 22 deletions
.../org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend
with
32 additions
and
22 deletions
plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend
+
32
−
22
View file @
2b9345a9
...
...
@@ -34,18 +34,19 @@ final class TDLtxProjectWithOpenAPI {
val lastUsed = "LAST_USED"
//TODO: file prompt?
//TODO: remove after testing
val advanced = check("Advanced:",
fals
e)
val advanced = check("Advanced:",
tru
e)
val advancedGroup = group("Properties")
// val name = combo("Package Name:", #["Example", "Sample", "Tutorial", "Pack"], "The name of the package", advancedGroup)
val name = text("Main Package Name:", "Main", "The name of the main package")
//TODO: add other options
val importStandard = check("Import TDL Library", true, "Import TDL standard library definitions.", advancedGroup)
val importHTTP = check("Import HTTP Library", false, "Import TDL HTTP library definitions.", advancedGroup)
val importHTTP = check("Import HTTP Library", true, "Import TDL HTTP library definitions.", advancedGroup)
val importJava = check("Import Java mapping libraries", false, "Import TDL Java mappings.", advancedGroup)
val extendedNature = check("Add additional natures", false, "Add Eclipse Plug-in and Java natures", advancedGroup)
val path = text("Path:", "tdl", "The package path to place the files in", advancedGroup)
val dataDefinitionsPath = text("Data DefinitionsPath:", s.getString(lastUsed), "The data definitions path to import from", advancedGroup)
val sourceMapping = text("Source mapping tag:", "SOURCE_MAPPING", "The source mapping tag to be used for the data mappings", advancedGroup)
val targetMapping = text("Target mapping tag:", "TARGET_MAPPING", "The target mapping tag to be used for the data mappings", advancedGroup)
//
val dataDefinitionsPath = text("Data DefinitionsPath:", s.getString(lastUsed), "The data definitions path to import from", advancedGroup)
//
val sourceMapping = text("Source mapping tag:", "SOURCE_MAPPING", "The source mapping tag to be used for the data mappings", advancedGroup)
//
val targetMapping = text("Target mapping tag:", "TARGET_MAPPING", "The target mapping tag to be used for the data mappings", advancedGroup)
@Inject
PluginImageHelper pluginImageHelper
...
...
@@ -57,20 +58,21 @@ final class TDLtxProjectWithOpenAPI {
importHTTP.enabled = advanced.value
extendedNature.enabled = advanced.value
dataDefinitionsPath.enabled = advanced.value
sourceMapping.enabled = advanced.value
targetMapping.enabled = advanced.value
//
dataDefinitionsPath.enabled = advanced.value
//
sourceMapping.enabled = advanced.value
//
targetMapping.enabled = advanced.value
if (!advanced.value) {
name.value = "Main"
path.value = "tdl"
importStandard.value = true
importHTTP.value = false
importHTTP.value = true
importJava.value = false
extendedNature.value = false
dataDefinitionsPath.value = s.getString(lastUsed)
sourceMapping.value = "SOURCE_MAPPING"
targetMapping.value = "TARGET_MAPPING"
//
dataDefinitionsPath.value = s.getString(lastUsed)
//
sourceMapping.value = "SOURCE_MAPPING"
//
targetMapping.value = "TARGET_MAPPING"
}
}
...
...
@@ -88,6 +90,7 @@ final class TDLtxProjectWithOpenAPI {
projectName = projectInfo.projectName
location = projectInfo.locationPath
projectNatures += #[XtextProjectHelper.NATURE_ID]
projectNatures += #["org.etsi.mts.tdl.nature"]
builderIds += #[XtextProjectHelper.BUILDER_ID]
if (extendedNature.value) {
projectNatures += #[JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature"]
...
...
@@ -107,22 +110,29 @@ final class TDLtxProjectWithOpenAPI {
imports += "Import all from HTTP\n"
imports += "Import all from HTTP.MessageBased\n"
}
if (importJava.value) {
addFile('''src/«path»/Java.tdltx''', TemplateHelper.getLibrary("Java"))
addFile('''src/«path»/TdlRuntime.tdltx''', TemplateHelper.getLibrary("TdlRuntime"))
if (importHTTP.value) {
addFile('''src/«path»/HttpJavaMappings.tdltx''', TemplateHelper.getLibrary("HttpJavaMappings"))
imports += "Import all from HttpJavaMappings\n"
}
imports += "Import all from Java\n"
}
//TODO: make target package name configurable? i.e. based on name
addFile('''src/«path»/imported.tdltx''',
ConverterNext.processToString(dataDefinitionsPath.value,
"src/"+path.value+"/Imported.tdltx",
sourceMapping.value,
targetMapping.value
))
val importsName = "generated_from_"+ConverterNext.getTargetPackageName(dataDefinitionsPath.value)
//
addFile('''src/«path»/imported.tdltx''',
//
ConverterNext.processToString(dataDefinitionsPath.value,
//
"src/"+path.value+"/Imported.tdltx",
//
sourceMapping.value,
//
targetMapping.value
//
))
//
val importsName = "generated_from_"+ConverterNext.getTargetPackageName(dataDefinitionsPath.value)
addFile('''src/«path»/«name».tdltx''', '''
/*
* This is an example package
*/
Package «name» {
Import all from TDL
Import all from «importsName»
Type simple
«imports»
}
''')
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment