added files

This commit is contained in:
Tony Tam
2015-11-17 20:14:53 -08:00
parent 28c4946945
commit d71d5ac119
16 changed files with 872 additions and 34 deletions

View File

@@ -10,4 +10,14 @@ public class SupportingFile {
this.folder = folder;
this.destinationFilename = destinationFilename;
}
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("SupportingFile:").append("\n");
builder.append("\ttemplateFile: ").append(templateFile).append("\n");
builder.append("\tfolder: ").append(folder).append("\n");
builder.append("\tdestinationFilename: ").append(destinationFilename).append("\n");
return builder.toString();
}
}

View File

@@ -48,22 +48,9 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
// set the output folder here
outputFolder = "generated-code/connexion";
/**
* Models. You can write model files using the modelTemplateFiles map.
* if you want to create one template for file, you can do so here.
* for multiple files for model, just put another entry in the `modelTemplateFiles` with
* a different extension
*/
modelTemplateFiles.clear();
/**
* Api classes. You can write classes for each Api file with the apiTemplateFiles map.
* as with models, add multiple entries with different extensions for multiple files per
* class
*/
apiTemplateFiles.put(
"controller.mustache", // the template to use
".py"); // the extension for each file to write
apiTemplateFiles.clear();
/**
* Template Location. This is the location which templates will be read from. The generator
@@ -104,10 +91,13 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
"",
"README.md")
);
supportingFiles.add(new SupportingFile("controller.mustache",
"controllers",
"default_controller.py")
);
if(!new java.io.File("controllers/default_controller.py").exists()) {
supportingFiles.add(new SupportingFile("controller.mustache",
"controllers",
"default_controller.py")
);
}
}
public String apiPackage() {

View File

@@ -78,7 +78,7 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
"api",
"swagger.yaml")
);
supportingFiles.add(new SupportingFile("app.mustache",
supportingFiles.add(new SupportingFile("index.mustache",
"",
"index.js")
);

View File

@@ -84,7 +84,7 @@ public class SilexServerCodegen extends DefaultCodegen implements CodegenConfig
supportingFiles.add(new SupportingFile("README.mustache", packagePath.replace('/', File.separatorChar), "README.md"));
supportingFiles.add(new SupportingFile("composer.json", packagePath.replace('/', File.separatorChar), "composer.json"));
supportingFiles.add(new SupportingFile("app.mustache", packagePath.replace('/', File.separatorChar), "index.php"));
supportingFiles.add(new SupportingFile("index.mustache", packagePath.replace('/', File.separatorChar), "index.php"));
supportingFiles.add(new SupportingFile(".htaccess", packagePath.replace('/', File.separatorChar), ".htaccess"));
}

View File

@@ -43,7 +43,7 @@ public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig {
outputFolder + "/assets/js", "jquery-1.8.3.min.js"));
supportingFiles.add(new SupportingFile("assets/js/main.js",
outputFolder + "/assets/js", "main.js"));
supportingFiles.add(new SupportingFile("app.mustache",
supportingFiles.add(new SupportingFile("index.mustache",
outputFolder, "index.html"));
instantiationTypes.put("array", "ArrayList");

View File

@@ -43,7 +43,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig
additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);
supportingFiles.add(new SupportingFile("app.mustache", "", "index.html"));
supportingFiles.add(new SupportingFile("index.mustache", "", "index.html"));
reservedWords = new HashSet<String>();
languageSpecificPrimitives = new HashSet<String>();