Skip to content

Commit

Permalink
renamed MPS Inspector to MPS Analyser
Browse files Browse the repository at this point in the history
  • Loading branch information
dslmeinte committed Sep 25, 2019
1 parent adeb253 commit 0f392ba
Show file tree
Hide file tree
Showing 39 changed files with 78 additions and 79 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Somewhat in order of rather shallowly descending importance:
* Avoid having to use the Inspector for input (e.g., 2 occurrences in the XSD language).


## MPS Inspector
## MPS Analyser

The MPS Inspector is a commandline tool meant for use in conjunction with [JetBrains' MPS](https://www.jetbrains.com/mps/), working directly on MPS project files.
For further information: [see here](./mps-inspector/README.md).
The MPS Analyser is a commandline tool meant for use in conjunction with [JetBrains' MPS](https://www.jetbrains.com/mps/), working directly on MPS project files.
For further information: [see here](./mps-analyser/README.md).

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions mps-inspector/README.md → mps-analyser/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# README

The MPS Inspector is a commandline tool meant for use in conjunction with [JetBrains' MPS](https://www.jetbrains.com/mps/), working directly on MPS project files.
The MPS Analyser is a commandline tool meant for use in conjunction with [JetBrains' MPS](https://www.jetbrains.com/mps/), working directly on MPS project files.
It works on an MPS project, and can perform various maintenance functions on MPS XML files - such files have extension `.mpl`, `.msd`, or `.mps`.
(It relies heavily on the assumption that the standard persistence strategy is used.)

Expand All @@ -10,7 +10,7 @@ It works on an MPS project, and can perform various maintenance functions on MPS
The tool takes the form of a Java JAR file that can be downloaded from the releases section, and can be run from the commandline as follows:

```
java -jar mps-inspector-0.1.2.jar <path_to_configuration.json or '-'>
java -jar mps-analyser-0.2.3.jar <path_to_configuration.json or '-'>
```

(Obviously, this presumes that Java is installed.
Expand All @@ -27,7 +27,7 @@ An example can be found [here](./src/test/resources/tryOnOwn.json).
The configuration consists of either one configuration item, or an array of them.
A configuration item is an object with properties with the following names, types, and meanings:

* `mpsProjectPath`: a string with the path (relative to the cwd) to the root of the MPS project to inspect.
* `mpsProjectPath`: a string with the path (relative to the cwd) to the root of the MPS project to analyse.
* `sortModules`: `true`/`false`, determines whether to sort the entries in the file `.mps/modules.xml`.
This has no effect on (the loading of) the MPS project itself, but makes it easier to manually compare revisions of this file.
* `usageAnalysisPath`: a string with the path (relative to the cwd) to which a report of a usage analysis (see [below](#usage-analysis)) is written.
Expand Down Expand Up @@ -57,7 +57,7 @@ The fully-qualified name of a feature is of the following form: `<fully-qualifie
## Raison d'être

The reason for this tool's existence is wanting to have some way to in(tro)spect MPS projects outside of MPS itself.
Instead of trying to shoehorn such functionality into an MPS plugin, the idea is to run a separate process that inspects, and potentially auto-fixes MPS XML files.
Instead of trying to shoehorn such functionality into an MPS plugin, the idea is to run a separate process that analyses, and potentially auto-fixes MPS XML files.
Also, running MPS headless is typically somewhat problematic to set up, and get/keep working.
As this tool proves, it's not always necessary to actually load and run MPS.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
8 changes: 4 additions & 4 deletions mps-inspector/pom.xml → mps-analyser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<modelVersion>4.0.0</modelVersion>

<groupId>nl.dslconsultancy.mps</groupId>
<artifactId>mps-inspector</artifactId>
<version>0.2.3-SNAPSHOT</version>
<artifactId>mps-analyser</artifactId>
<version>0.2.3</version>
<packaging>jar</packaging>

<name>MPS Inspector</name>
<name>MPS Analyser</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -100,7 +100,7 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>nl.dslconsultancy.mps.inspector.MainKt</mainClass>
<mainClass>nl.dslconsultancy.mps.analyser.MainKt</mainClass>
</manifest>
</archive>
<descriptorRefs>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.core.JsonProcessingException
import com.fasterxml.jackson.databind.exc.MismatchedInputException
import nl.dslconsultancy.mps.inspector.util.JacksonJsonUtil.jsonFromString
import nl.dslconsultancy.mps.inspector.xml.modelXmlWithoutNodesFromDisk
import nl.dslconsultancy.mps.inspector.xml.modulesXmlPath
import nl.dslconsultancy.mps.inspector.xml.processModulesXml
import nl.dslconsultancy.mps.analyser.util.JacksonJsonUtil.jsonFromString
import nl.dslconsultancy.mps.analyser.xml.modelXmlWithoutNodesFromDisk
import nl.dslconsultancy.mps.analyser.xml.modulesXmlPath
import nl.dslconsultancy.mps.analyser.xml.processModulesXml
import java.nio.file.Files
import java.nio.file.Paths

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.JsonTypeInfo
import nl.dslconsultancy.mps.inspector.util.div
import nl.dslconsultancy.mps.inspector.xml.ProjectModule
import nl.dslconsultancy.mps.inspector.xml.asStructure
import nl.dslconsultancy.mps.inspector.xml.modelXmlFromDisk
import nl.dslconsultancy.mps.analyser.util.div
import nl.dslconsultancy.mps.analyser.xml.ProjectModule
import nl.dslconsultancy.mps.analyser.xml.asStructure
import nl.dslconsultancy.mps.analyser.xml.modelXmlFromDisk
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.attribute.BasicFileAttributes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import nl.dslconsultancy.mps.inspector.util.JacksonJsonUtil.writeJson
import nl.dslconsultancy.mps.inspector.util.csvRowOf
import nl.dslconsultancy.mps.inspector.util.div
import nl.dslconsultancy.mps.analyser.util.JacksonJsonUtil.writeJson
import nl.dslconsultancy.mps.analyser.util.csvRowOf
import nl.dslconsultancy.mps.analyser.util.div
import java.nio.file.Files
import java.nio.file.Paths

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import java.nio.file.Files
import java.nio.file.Paths
import kotlin.system.exitProcess

fun main(args: Array<String>) {
println("MPS Analyser v0.2.3")
if (args.isEmpty() || args[0].isEmpty()) {
System.err.println("must provide 1 arg: the relative path to a JSON file with the configuration, or '-' in which case you have to provide the JSON configuration on stdin")
exitProcess(1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import nl.dslconsultancy.mps.inspector.util.asList
import nl.dslconsultancy.mps.inspector.util.csvRowOf
import nl.dslconsultancy.mps.inspector.xml.languageMetaDataXmlFromDisk
import nl.dslconsultancy.mps.analyser.util.asList
import nl.dslconsultancy.mps.analyser.util.csvRowOf
import nl.dslconsultancy.mps.analyser.xml.languageMetaDataXmlFromDisk
import java.nio.file.Files
import java.nio.file.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import nl.dslconsultancy.mps.inspector.util.CountingMap
import nl.dslconsultancy.mps.inspector.util.asCsvRow
import nl.dslconsultancy.mps.inspector.util.combine
import nl.dslconsultancy.mps.inspector.util.csvRowOf
import nl.dslconsultancy.mps.inspector.xml.*
import nl.dslconsultancy.mps.analyser.util.CountingMap
import nl.dslconsultancy.mps.analyser.util.asCsvRow
import nl.dslconsultancy.mps.analyser.util.combine
import nl.dslconsultancy.mps.analyser.util.csvRowOf
import nl.dslconsultancy.mps.analyser.xml.*

/*
* CountingMap is keyed with a fully-qualified name of a concept or a feature.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector.util
package nl.dslconsultancy.mps.analyser.util

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector.util
package nl.dslconsultancy.mps.analyser.util

import com.ctc.wstx.api.WstxOutputProperties
import com.fasterxml.jackson.databind.DeserializationFeature
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector.util
package nl.dslconsultancy.mps.analyser.util

import java.io.File
import java.nio.file.Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector.util
package nl.dslconsultancy.mps.analyser.util

import org.w3c.dom.Document
import org.w3c.dom.Node
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import nl.dslconsultancy.mps.inspector.Dependency
import nl.dslconsultancy.mps.inspector.Language
import nl.dslconsultancy.mps.inspector.util.XmlDomUtil.readXml
import nl.dslconsultancy.mps.inspector.util.attribute
import nl.dslconsultancy.mps.inspector.util.firstChild
import nl.dslconsultancy.mps.inspector.util.textContents
import nl.dslconsultancy.mps.inspector.util.xPathAsNodes
import nl.dslconsultancy.mps.analyser.Dependency
import nl.dslconsultancy.mps.analyser.Language
import nl.dslconsultancy.mps.analyser.util.XmlDomUtil.readXml
import nl.dslconsultancy.mps.analyser.util.attribute
import nl.dslconsultancy.mps.analyser.util.firstChild
import nl.dslconsultancy.mps.analyser.util.textContents
import nl.dslconsultancy.mps.analyser.util.xPathAsNodes
import java.nio.file.Path

fun languageMetaDataXmlFromDisk(path: Path): Language {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import nl.dslconsultancy.mps.inspector.util.lastSection
import nl.dslconsultancy.mps.analyser.util.lastSection

/*
* Subsequent 3 data class having names of the form "Meta<X>Xml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonRootName
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import nl.dslconsultancy.mps.inspector.util.JacksonXmlUtil.xmlFromDisk
import nl.dslconsultancy.mps.analyser.util.JacksonXmlUtil.xmlFromDisk
import java.nio.file.Path

@JsonRootName("model")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonRootName
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import nl.dslconsultancy.mps.inspector.MpsProject
import nl.dslconsultancy.mps.inspector.render
import nl.dslconsultancy.mps.inspector.util.JacksonXmlUtil.writeXml
import nl.dslconsultancy.mps.inspector.util.JacksonXmlUtil.xmlFromDisk
import nl.dslconsultancy.mps.inspector.util.div
import nl.dslconsultancy.mps.inspector.util.isSorted
import nl.dslconsultancy.mps.inspector.util.lastSection
import nl.dslconsultancy.mps.analyser.MpsProject
import nl.dslconsultancy.mps.analyser.render
import nl.dslconsultancy.mps.analyser.util.JacksonXmlUtil.writeXml
import nl.dslconsultancy.mps.analyser.util.JacksonXmlUtil.xmlFromDisk
import nl.dslconsultancy.mps.analyser.util.div
import nl.dslconsultancy.mps.analyser.util.isSorted
import nl.dslconsultancy.mps.analyser.util.lastSection
import java.nio.file.Path

@JsonRootName("project")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import nl.dslconsultancy.mps.inspector.*
import nl.dslconsultancy.mps.inspector.util.lastSection
import nl.dslconsultancy.mps.analyser.*
import nl.dslconsultancy.mps.analyser.util.lastSection

fun ModelXml.asStructure(): Structure {
val metaConcepts = metaConcepts()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector
package nl.dslconsultancy.mps.analyser

import kotlin.test.Test
import kotlin.test.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.dslconsultancy.mps.inspector.util
package nl.dslconsultancy.mps.analyser.util

import java.util.*
import kotlin.test.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import com.fasterxml.jackson.annotation.JsonBackReference
import com.fasterxml.jackson.annotation.JsonManagedReference
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText
import com.fasterxml.jackson.module.kotlin.readValue
import nl.dslconsultancy.mps.inspector.util.JacksonJsonUtil
import nl.dslconsultancy.mps.inspector.util.JacksonXmlUtil
import nl.dslconsultancy.mps.analyser.util.JacksonJsonUtil
import nl.dslconsultancy.mps.analyser.util.JacksonXmlUtil
import kotlin.test.Ignore
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.BooleanNode
import com.fasterxml.jackson.databind.node.DecimalNode
import com.fasterxml.jackson.databind.node.NullNode
import com.fasterxml.jackson.databind.node.TextNode
import nl.dslconsultancy.mps.inspector.util.JacksonJsonUtil
import nl.dslconsultancy.mps.analyser.util.JacksonJsonUtil
import java.math.BigDecimal

sealed class IJsonValue {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nl.dslconsultancy.mps.inspector.xml
package nl.dslconsultancy.mps.analyser.xml

import nl.dslconsultancy.mps.inspector.util.JacksonJsonUtil.jsonMapper
import nl.dslconsultancy.mps.inspector.util.lastSection
import nl.dslconsultancy.mps.analyser.util.JacksonJsonUtil.jsonMapper
import nl.dslconsultancy.mps.analyser.util.lastSection
import java.nio.file.Paths
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down
2 changes: 0 additions & 2 deletions mps-inspector/mps-inspector.iml

This file was deleted.

0 comments on commit 0f392ba

Please sign in to comment.