-
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.
mps-cli-gradle-plugin: added a application to demonstrate the library
- Loading branch information
Showing
3 changed files
with
34 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
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
23 changes: 23 additions & 0 deletions
23
mps-cli-gradle-plugin/plugin/src/main/groovy/org/mps_cli/MpsCliDemo.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 @@ | ||
package org.mps_cli | ||
|
||
import org.mps_cli.model.SSolutionModule; | ||
import org.mps_cli.model.builder.BuildingDepthEnum | ||
import org.mps_cli.model.builder.SModulesRepositoryBuilder | ||
|
||
class MpsCliDemo { | ||
|
||
static void main(String[] args) { | ||
if (args.length != 1) { | ||
print("Usage: 'gradlew run --args PATH_TO_DIRECTORY_CONTAINING_MPS_SOLUTIONS") | ||
exit(1) | ||
} | ||
println("Loading models from '${args[0]}' ...") | ||
def builder = new SModulesRepositoryBuilder(buildingStrategy: BuildingDepthEnum.COMPLETE_MODEL) | ||
def repo = builder.build(args[0]) | ||
|
||
println("Statistics:") | ||
println("\t number of modules: " + repo.modules.findAll {it instanceof SSolutionModule }.size()) | ||
println("\t number of models: " + repo.allModels().size()) | ||
println("\t number of nodes: " + repo.allNodes().size()) | ||
} | ||
} |