Skip to content

Commit

Permalink
Update based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsimafei Raro committed Aug 22, 2022
1 parent ff874bc commit 66924ef
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 27 deletions.
23 changes: 0 additions & 23 deletions s-pipes-modules-utils/regen.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# A small helper script for updating the archetype in the local maven repo,
# removing the old test module and generating a new one

# Change the variables below as necessary
ARCHETYPE_GROUP_ID="cz.cvut.kbss"
ARCHETYPE_ARTIFACT_ID="s-pipes-module-archetype"
ARCHETYPE_VERSION="0.4.0"

NEW_MODULE_GROUP_ID="cz.cvut.spipes.modules"
NEW_MODULE_ARTIFACT_ID="test-own-artifact"
NEW_MODULE_NAME="foobar"

ARCHETYPE_DIR=../
SPIPES_MODULES_DIR=$ARCHETYPE_DIR/../s-pipes-modules


cd $ARCHETYPE_DIR
mvn clean install archetype:update-local-catalog -q
echo "Updated archetype in local maven repository"

cd $SPIPES_MODULES_DIR
# Cleanup of old versions
rm -rf $NEW_MODULE_ARTIFACT_ID
sed -i '' "s/<module>$NEW_MODULE_ARTIFACT_ID<\/module>//" pom.xml
echo "Cleaned up the old version"

mvn archetype:generate \
-DinteractiveMode=false \
-DarchetypeGroupId=$ARCHETYPE_GROUP_ID \
-DarchetypeArtifactId=$ARCHETYPE_ARTIFACT_ID \
-DarchetypeVersion=$ARCHETYPE_VERSION \
-DgroupId=$NEW_MODULE_GROUP_ID\
-DartifactId=$NEW_MODULE_ARTIFACT_ID \
-DmoduleName=$NEW_MODULE_NAME -q
echo "Regenerated the test module"
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ public String getTypeURI() {

@Override
public void loadConfiguration() {
LOG.info("Configuration loaded successfully.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void setUp() {
}

@Test
public void loadConfiguration_doesNotThrow() {
void loadConfiguration_doesNotThrow() {
assertDoesNotThrow(() -> module.loadConfiguration());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import cz.cvut.spipes.constants.SM;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.util.FileUtils;
import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.RDFS;
import org.apache.maven.plugin.AbstractMojo;
Expand Down Expand Up @@ -93,7 +94,7 @@ private void writeConstraintsToOutputFile(List<cz.cvut.spipes.modules.Parameter>
"(name = " + annotation.name() + ", urlPrefix = " + annotation.urlPrefix() + ")");
}
}
model.write(new FileOutputStream(ontologyFilepath), "TTL");
model.write(new FileOutputStream(ontologyFilepath), FileUtils.langTurtle);
log.info("Successfully written constraints to the ontology file: " + ontologyFilepath);
}
}

0 comments on commit 66924ef

Please sign in to comment.