How to use a smile project

Smile Modules

Module Type
specification file extension
description
data-module kdata Contains data for the project like role, enums, data.
mongo-module kmongo Holds the definition of mongo collections
slick-module kslick Holds the definition of RDBMS tables
domain-module kdomain Contains domains and procs
play-module kplay Play specification like controllers and actions
script-module kscript Holds script and scheduler information

General Commands

command It does
> smile creates new module structure and updates ApplicationBuild.scala to accommodate new module
> delete-module deletes given modulename under the given group name
> create-smile-runner creates smile under 'target' directory
> reload reloads project
> prepare generates xml file for spec
> generate generates source code for the spec
> compile  compiles source code, compile depends on generate and generate depends on prepare, so any change in spec file and compile in sbt will take care of prepare and generate automatically
> prepare-force Prepares the xml file even if it does not change
> generate-force  Forces the code-generation

Test Commands

command It does
> test     runs the tests
> test-only <fqTestSuiteName> – -n <tagName> runs tests with specified tag name
> create-test-suite <packageName>.TestSuiteName creates new TestSuite

Mongo Commands

command It does
> count <collection name> counts number of documents for the specified collection
> count-all counts number of documents for all collections
> diff shows the difference between collections(columns) if any change
> drop <collection name> drops the specified collection
> drop-collections drops all the collections
> ensure-indices <collection name> ensure indices for the specified collection
> ensure-all-Indices ensure indices for all collections
> drop-indices <collection name> drops indices for the specified collection
> drop-all-indices drops indices for all collections
> schema-info displays the migration status info
> schema-migrate  migrates only next one
> schema-migrate-all migrates all the available files
> schema-clean cleans db schema
> schema-create-json <description> <description> creates a json file for mongo migration as V<latest version>_<description>_<description>.json
> schema-create-scala creates a scala file for mongo migration as V<latest version>_<description>_<description>.scala
> data-info displays data upload info
> data-till <number> Uploads data till the number provided (D_<number>)
> data-create-json creates a json file for mongo data upload as D<latest version>_<description>_<description>.json(Data upload)
> data-create-scala creates a scala file for mongo data upload as D<latest version>_<description>_<description>.scala(Data upload)

Slick Commands

command It does
> pre-prepare updates kslick file from the database for all tables
> pre-prepare updates kslick file for the given table name
> schema-init initialize schema
> schema-info shows schema info
> schema-validate validate migration
> schema-migrate migrate up to the latest
> schema-clean cleans schema
> schema-repair repairs schema
> schema-create-sql creates a sql file for slick migration V<latest version>_<description>_<description>.sql
> schema-create-scala creates a scala file for slick migration V<latest version>_<description>_<description>.scala

Script Commands

command It does
> run-script once <ScriptName> <input if any in name=value> runs script one time
> run-script multiple <times> <gap> <ScriptName> <input if any name=value> runs script <times> time with a gap of <gap>

Project Structure

The project for an Activator template should have the following layout:

The project must set a required SBT version in the /project/build.properties file, like:

this is very nice

An excellent stuff coming here ...

Testing

>test

>test-only <fqTestSuiteName> – -n <testName>

>create-test-suite a.BType