The sections below describe the steps required to create and release a Play 1 module along with a corresponding sample application:
- The steps are based on how Play 1 Chart was created
- Some steps may be redundant or missing
- The order of the steps is not strict i.e. some steps may be executed earlier/later than specified
- Some steps may vary according to user preferences (e.g. preferred text editor)
<>
refers to a placeholder (e.g.<module>
is a placeholder for a module name)- Linux, Eclipse and Play 1.3 are assumed to be part of the development environment
- UNIX commands are assumed to take place on the path determined by the most recently executed
cd
command
- Create module:
play new-module <module>
- The module name must match regex
[a-zA-Z]+
- Build module:
cd <module>; play build-module
- Press enter when asked about required Play Framework versions
- Add JAR files required by the module to the
lib
directory - Eclipsify module:
cd ..; play eclipsify <module>
- Import module project into Eclipse:
File -> Import -> General -> Existing Project into Workspace
- Add module code to the
src
directory under packageplay.modules.<module>
- Add module fast tags to under
app/tags
- Write and execute tests
- Add documentation to
documentation/manual/home.textile
- Document all public API methods using Javadoc
- Execute
play javadoc
and check that: - All public API methods are documented
- No module related Javadoc errors are found in log files (under the
logs
directory) - Check that no code problems are reported by Eclipse
- Check that no unnecessary logging is generated by the module (search the code for
Logger
) - Build module:
cd <module>; play build-module
- Press enter when asked about required Play Framework versions
- Create sample application under the module's directory:
cd <module>; play new samples-and-tests; cd samples-and-tests
- Enter
Play <module> Module App
when asked about the application name
- Add
samples-and-tests/app
as a source folder in Eclipse (in order to navigate through source files) - Set
<module>
as a sample application's dependency during development: see Appendix A - Resolve dependencies:
play deps
- File
<module>
shows up under the modules directory and its content is the path to the module - Check that the module can be used:
play <module>:hello
:Hello
is displayedplay run
:INFO ~ Module <module> is available (<path to module>)
is displayed- Implement the sample application
- Write and execute tests
cd <module>
- Remove unnecessary files/directories (e.g.
conf/messages
,conf/routes
) rm -fr dist; play build-module
- Press enter when asked about required Play Framework versions
- Test the sample application
cd samples-and-tests
play test
and execute automated tests (http://localhost:9000/@tests
)play clean; play deps; play run
and test manually (http://localhost:9000
)- Configure the sample application for release
- Add
<module>
as a sample application's dependency for release: see Appendix B play deps; play clean
- Remove unnecessary directories:
javadoc
,modules
andtest-result
- Check that no unnecessary files exist
- Configure the module for release and archive it
- Set
<module>
dependencies for release: see Appendix C cd <module>; rm -fr dist; play build-module
- Press enter when asked about required Play Framework versions- A zip file is generated under
<module>/dist
- Exclude unnecessary files from the module's zip file:
zip -d <module>-<version>.zip README commands.pyc
- Exclude any other unnecessary files/directories:
1. Files:
.classpath
,.project
,.gitignore
1. Directories:.settings
,eclipse
,javadoc
,logs
,.git
, empty directories (e.g.public
) - Archive the module's zip file under a release directory (e.g. outside the module directory, in a directory named
<release date>
) rm -fr dist
- Add module to local Git repository: see Appendix D
- Publish module on GitHub: see Appendix E
- Create module web page in GitHub: see Appendix F
- Post a module registration request on the play-framework Google Group using the e-mail template specified in Appendix G
In order to set <module>
as a sample application's dependency during development, set the contents of the sample application's conf/dependencies.yml
to:
# Application dependencies
require:
- play
- <module> -> <module> <version>
repositories:
- <repository>:
type: local
artifact: "<path to module>"
contains:
- <module> -> *
where is the module version (e.g. 0.1
).
NB: dependencies.yml
must not include any tab characters.
In order to set <module>
as a sample application's dependency for release, set the contents of the sample application's conf/dependencies.yml
to:
# Application dependencies
require:
- play -> <module> <version>
where is the module version (e.g. 0.1
).
NB: dependencies.yml
must not include any tab characters.
In order to configure the module's dependencies for release, set the contents of the module's conf/dependencies.yml
to:
self: play -> <module> <version>
require:
- <module>
where is the module version (e.g. 0.1
).
NB: dependencies.yml
must not include any tab characters.
-
cd <module_directory>
-
git init
1.vi .gitignore
and include (at least):.classpath eclipse .project .settings commands.pyc
-
vi .gitignore
and include (at least):.classpath eclipse .project .settings commands.pyc
-
vi README
(recommended for all GitHub repositories):# play1-<module> Play 1 <module> module Home page: http://<user>.github.io/play1-<module>/
-
vi LICENSE
(recommended for all GitHub repositories) -
git status
: all files should be unstaged -
Add all files recursively:
git add .
-
git status
: all files should be staged -
Commit:
git commit -m "Play 1 <module> module <version>"
-
Tag project:
git tag <tagname>
(e.g.git tag 0.1.0
) -
git status
: all files should be committed i.e. on the master HEAD of the local copy
- Create repository in GitHub:
- Log in GitHub
- New repository
- Name:
play1-<module>
- Description (optional): Play 1
<module>
module - Public
- Create repository
- Note the repository SSH URL:
[email protected]:<user>/play1-<module>.git
- Push local repository to GitHub one:
cd <module>
- Associate GitHub (remote) repository with local one:
git remote add origin <repository SSH URL>
- Push files from local repository to GitHub:
git push -u origin master
- Push tag to remote:
git push origin <tagname>
(e.g.git push origin 0.1.0
)
cd <module release directory>
(where the module's zip file resides)- Convert module's textile documentation to GitHub's markdown:
pandoc <path to module>/documentation/manual/home.textile -t markdown -o home.md
- In Github, go to the repository, press Settings and then automatic page generator
- Copy/paste the contents of
home.md
onto the body - Press "Continue to layouts"
- Select layout
- Preview page and check that everything's ok, as GitHub Markdown is different from Markdown (adjust text if necessary)
- Publish page
Subject: [play-framework] [1.3.x] Module registration request: <module>
To: [email protected]
Module name:
<module>
Display name:
<module display name>
Description:
The <module display name> module <module's purpose>.
Project home page:
http://<user>.github.io/<module repository name on GitHub>/