Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 862e4ac4 authored by Alexandre.B's avatar Alexandre.B
Browse files

ABEC - mise à jour des fichiers archetype

parent 352fb202
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" name="sample-project-archetype"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="sample-project-archetype">
<requiredProperties>
<requiredProperty key="groupeId">
<defaultValue>com.spring.boot</defaultValue>
......
dir = new File(new File(request.outputDirectory), request.artifactId)
idea = new File(dir, ".idea")
def run(String cmd) {
def process = cmd.execute(null, dir)
process.waitForProcessOutput((Appendable)System.out, System.err)
if (process.exitValue() != 0) {
throw new Exception("Command '$cmd' exited with code: ${process.exitValue()}")
}
}
def writeCodeStyle() {
def sb = new StringBuilder()
sb.append('<component name="ProjectCodeStyleConfiguration">\n')
new URL(request.properties["intellijCodeStyleUrl"]).eachLine {
sb.append(" " + it + "\n")
}
sb.append("</component>")
xml = sb.toString()
xml = xml.replaceFirst('<code_scheme name="[^"]+"', '<code_scheme name="Project"')
def codeStyles = new File((File) idea, "codeStyles")
def file = new File(codeStyles, "Project.xml")
file.setText(xml, "UTF-8")
}
def writeInspectionProfile() {
def sb = new StringBuilder()
sb.append('<component name="InspectionProjectProfileManager">\n')
def url = request.properties["intellijInspectionProfileUrl"]
new URL(url).eachLine {
sb.append(" " + it + "\n")
}
sb.append("</component>")
xml = sb.toString()
def m = (~/<option name="myName" value="([^"]+)"/).matcher(xml)
if (!m.find()) {
throw new RuntimeException("Unable to find inspection profile name in " + url)
}
def name = m.group(1)
def inspectionProfiles = new File((File) idea, "inspectionProfiles")
def file = new File(inspectionProfiles, name + ".xml")
file.setText(xml, "UTF-8")
def settings = new File(inspectionProfiles, "profiles_settings.xml")
def contents = settings.getText("UTF-8").replaceFirst("@intellijInspectionProfileName@", name)
settings.setText(contents, "UTF-8")
}
run("mvn -N io.takari:maven:wrapper -DskipNotification")
run("./mvnw sortpom:sort -DskipNotification")
run("./mvnw fmt:format -DskipNotification")
writeCodeStyle()
writeInspectionProfile()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment