Slate Kit comes with a command line executable to serve as a project generator. This is simply a Kotlin executable jar packaged as a Java Application via gradle that can be executed on the command line with bash/batch scripts. The application takes a template comprised of a instructions, along with files/folders that are copied to a new destinated folder representing the app to create. The files contain placeholder values that replaced the name of the app aamong other things. This is a minimal version of nodejs yeoman or python cookie-cutter
slatekit new app -name="Sample1" -package="mycompany.apps"
Goal | Description |
1. Templated | Template out different project types for fast setup |
2. Consistency | Create consistent/standardized applications |
3. Extensible | Extend the default generator with new packages/templates |
This component is currently stable with planned future features
Feature | Status | Description |
Questions | Future | Support for questions/answers |
Scripting | Future | Support for scripting via either Kotlin Scripting or Gradle |
Settings | Future | Additional settings ( e.g. to set version of Kotlin, Slate Kit, Java) |
Git | Future | Downloadable templates from Git or other external sources |
You can install the slatekit application/command line tool from slatekit
// For mac,nix
slatekit
// For windows
slatekit.bat
slatekit -version
slatekit -help
Jar | slatekit.generator.jar |
Package | slatekit.generator |
Sources | slatekit-generator |
Example | Example_Generator.kt |
Version | |
License | |
Requires | See build.gradle for more info. |
Section | Component | Description |
1 | Status | Current status of this component |
2 | Install | Installation instructions and references to sources |
3 | Requires | Lists all the Slate Kit and third-party dependencies |
4 | APP | Generate a new console application |
5 | API | Generate a new HTTP API |
6 | CLI | Generate a new console CLI (command line interface) application |
7 | JOB | Generate a new backgroun job |
8 | LIB | Generate a new reusable library |
9 | ORM | Generate a new Domain Driven Database/Entites/ORM project |
10 | Custom | Create custom templates |
11 | Help | More info and help on the generators |
Download
Step | Sample | Description |
Download | ~/tools/slatekit | Download tools to your local folder |
Path | ~/tools/slatekit | Optional: Modify your path and include the directory where slatekit scripts are located. |
Project templates
{
"name": "app",
"description": "Generates a slatekit.app console application",
"version": "1.0.0",
"url": "https://www.slatekit.com",
"contact": "https://www.slatekit.com",
"keywords": ["slatekit", "app"],
"type": "application",
"actions": [
{ "type": "copy", "doc": "Build", "source": "/build.txt" , "target": "/build.gradle" },
{ "type": "copy", "doc": "Build", "source": "/settings.txt", "target": "/settings.gradle" },
{ "type": "copy", "doc": "Code" , "source": "/src/Run.txt" , "target": "/src/main/kotlin/${app.packagePath}/Run.kt" },
{ "type": "copy", "doc": "Code" , "source": "/src/App.txt" , "target": "/src/main/kotlin/${app.packagePath}/App.kt" }
],
"dependencies": {
"common": "1.0.0",
"conf": "1.0.0"
}
}
You can generate a new project by running slatekit with the appropriate commands. Sample structure is shown below
# name = name of application / folder name
# package = the kotlin package name for the app
slatekit new app -name="Sample1" -package="mycompany.apps"
The Slate App is a base application and template to build console, batch, cli and server applications. It has pre-built support for common features such as command line args, environment selection, configs per environment, logging, life-cycle events, diagnostics and much more. You can create a app quickly using the Slate Kit command line executable with the following inputs. Also refer to the Example_App.kt.
slatekit new app -name="Sample1" -package="mycompany.apps"
The Slate App is a base application and template to build console, batch, cli and server applications. It has pre-built support for common features such as command line args, environment selection, configs per environment, logging, life-cycle events, diagnostics and much more. You can create a app quickly using the Slate Kit command line executable with the following inputs. Also refer to the Example_App.kt.
slatekit new api -name="Sample1" -package="mycompany.apps"
The Slate App is a base application and template to build console, batch, cli and server applications. It has pre-built support for common features such as command line args, environment selection, configs per environment, logging, life-cycle events, diagnostics and much more. You can create a app quickly using the Slate Kit command line executable with the following inputs. Also refer to the Example_App.kt.
slatekit new cli -name="Sample1" -package="mycompany.apps"
The Slate App is a base application and template to build console, batch, cli and server applications. It has pre-built support for common features such as command line args, environment selection, configs per environment, logging, life-cycle events, diagnostics and much more. You can create a app quickly using the Slate Kit command line executable with the following inputs. Also refer to the Example_App.kt.
slatekit new job -name="Sample1" -package="mycompany.apps"
The Slate App is a base application and template to build console, batch, cli and server applications. It has pre-built support for common features such as command line args, environment selection, configs per environment, logging, life-cycle events, diagnostics and much more. You can create a app quickly using the Slate Kit command line executable with the following inputs. Also refer to the Example_App.kt.
slatekit new job -name="Sample1" -package="mycompany.apps"
The Slate App is a base application and template to build console, batch, cli and server applications. It has pre-built support for common features such as command line args, environment selection, configs per environment, logging, life-cycle events, diagnostics and much more. You can create a app quickly using the Slate Kit command line executable with the following inputs. Also refer to the Example_App.kt.
slatekit new orm -name="Sample1" -package="mycompany.apps"
The command line generator can be extended with custom templates. You have to create various configuration files and instructions similar to the existing ones. Refer to a sample configuration for the App for more info
slatekit new my_service_template -name="Service1" -package="mycompany.services"
You can also get help on the command for each project type. Run the following commands
slatekit new app -help
slatekit new api -help
slatekit new cli -help
slatekit new job -help
slatekit new lib -help
slatekit new orm -help