@@ -41,7 +41,7 @@ class Plugin(val pluginSourceDirectoryName: String, val name: String) {
41
41
val sbtFile = new SbtFile (name, version)
42
42
43
43
// The name of the sbt file is the plugin name. This worked in first tests
44
- sbtFile.save(s " $pluginDirectoryPath/ $name .sbt " )
44
+ sbtFile.save(s " $pluginDirectoryPath/ $normalizedName .sbt " )
45
45
}
46
46
47
47
/**
@@ -82,12 +82,11 @@ class Plugin(val pluginSourceDirectoryName: String, val name: String) {
82
82
* @return true, if everything was successful
83
83
*/
84
84
def createSourceFile (language : PluginLanguage .Value ): Boolean = {
85
- val content = PluginLanguage .getSourceFileContent(name , language)
85
+ val content = PluginLanguage .getSourceFileContent(normalizedName , language)
86
86
val langName = language.toString.toLowerCase
87
87
88
-
89
88
Try (
90
- IO .write(new File (s " $pluginDirectoryPath/src/main/ $langName/ ${name }Plugin. $langName" ), content.getBytes)
89
+ IO .write(new File (s " $pluginDirectoryPath/src/main/ $langName/ ${normalizedName }Plugin. $langName" ), content.getBytes)
91
90
).isSuccess
92
91
}
93
92
@@ -148,7 +147,7 @@ object Plugin {
148
147
pluginSourceFolder.exists() && pluginSourceFolder.isDirectory
149
148
}
150
149
151
- private def toPluginPathName (name : String ) = name.replace( " " , " " ).toLowerCase
150
+ private def toPluginPathName (name : String ) = name.replaceAll( " [ -] " , " " ).toLowerCase
152
151
153
152
private def containsPluginXMLFile (directory : File ): Boolean = {
154
153
new File (s " $directory/src/main/resources/plugin.xml " ).exists()
0 commit comments