Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 110 lines (75 sloc) 3.931 kB
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
1 Introduction
2 ============
3
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
4 This project is meant as starting point for Trifork projects that use Gradle
5 as build-system. It is a good idea to become familiar with Gradle, and the
6 [Gradle Userguide](http://gradle.org/documentation.html) is a very good
7 reference.
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
8
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
9 To get started make a git repository and add this repository as a remote:
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
10
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
11 git remote add template git://github.com/trifork/gradle-template.git
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
12
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
13 That way you can also easily get any future additions:
14
8e4f259 @anagrius Fixed pull command to include branch.
anagrius authored
15 git pull template master
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
16
17 The template contains two example sub-projects, one Java and one Scala.
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
18
19 Suggestions and patches (or pull requests) are very welcome. If you encounter
20 any bugs please make an issue on Github.
21
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
22 Build Customization
8ea7158 @anagrius Small format and typo corrections in the readme.
anagrius authored
23 -------------------
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
24
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
25 Take a look in 'gradle.properties', 'build.gradle', 'settings.gradle' and in
26 the config-directory to customize the build to fit your project.
27
28 There are very few things that actually need to be changed in the build
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
29 configuration – at least to start out with.
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
30 But there are though a couple of properties you need to change in
31 'gradle.properties'.
32
33 First off, you will have to change the name of the `projectName` and
34 `nextReleaseVersion` properties. These properties are defined in
35 `gradle.properties` file. The properties are described in greater detail in
36 the file itself.
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
37
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
38 If you do not want to use Jira or use some other SCM than Git you will also
39 have to change some settings in the `config/deployment.groovy` file.
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
40
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
41 Coding standards and formatting is checked using Checkstyle. You can edit them
42 to fit your project in `config/checkstyle/checkstyle.xml`.
43
44 Dependency Management
45 ---------------------
46
47 It is a good idea to keep a list of dependencies you use in several
e00c56c @anagrius Migrated to using the Gradle plugin system.
anagrius authored
48 sub-projects in the `config/libraries.groovy` file. That way you can keep
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
49 versions consistent. There is of course nothing that is stopping your from
e00c56c @anagrius Migrated to using the Gradle plugin system.
anagrius authored
50 declaring dependencies on an ad-hoc basis in your sub-projects. But this can
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
51 quickly get out of hand for larger projects.
52
e00c56c @anagrius Migrated to using the Gradle plugin system.
anagrius authored
53 Plugins
54 -------
55
56 Gradle has a good plugin system. By default Gradle comes with a lot of handy
57 plugins, but they are quite general and need some customization. Therefore
58 there is a set plugin specificly made for Trifork projects.
59
60 By default only the `deployment` plugin is added. It helps you use the
61 Trifork nexus server correctly and use a consistent scheme for deployment of
62 artifacts, both class and source files.
63
64 All the plugins are described in the Plugin Project's README. You can find it
65 [here](https://github.com/trifork/gradle-plugins).
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
66
67 Releases & Snapshots
68 --------------------
69
e00c56c @anagrius Migrated to using the Gradle plugin system.
anagrius authored
70 When you apply the deployment-plugin you get a few extra tasks to help you
71 share your artifacts.
72
73 It is important to have a well-defined and consistent way of sharing jar files
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
74 and other artifacts. Maven repos are the de-facto standard for artifact
e00c56c @anagrius Migrated to using the Gradle plugin system.
anagrius authored
75 sharing and by using it you get a high degree of interoperability between
76 build systems.
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
77
9534753 @anagrius Added notes about deploying snapshots.
anagrius authored
78 When making a release it is important to make sure that you don't
2fb9871 @anagrius Updated the readme with notes on how to release and deploy artifacts.
anagrius authored
79 depend on any snapshot artifacts. Since snapshots change over time, future
80 snapshot versions will potentially break your release (which is bad).
51544f5 @anagrius Fixed the project names in the POM files and updated the readme.
anagrius authored
81
9534753 @anagrius Added notes about deploying snapshots.
anagrius authored
82 TODO: In future this check might be automated.
83
7e34c07 @anagrius Added some tips for git.
anagrius authored
84 Git Tips
8ea7158 @anagrius Small format and typo corrections in the readme.
anagrius authored
85 --------
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
86
7e34c07 @anagrius Added some tips for git.
anagrius authored
87 It is a good idea to check your code before you push anything to other central
88 repositories. While you don't necessarily want to run tests and check code for
89 every commit you do locally.
90
91 You can setup a git command alias to check your code before you push anything.
92
93 git config alias.publish '! gradle check && git push "$@"'
94
95 This will allow you to e.g. write:
96
97 git publish origin master
98
99 as an alternative to `git push`. Please note that since you will be running
100 tests and other code checks this will usually take considerably longer than
101 a normal push.
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
102
103 Requirements
8ea7158 @anagrius Small format and typo corrections in the readme.
anagrius authored
104 ------------
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
105
8e83ed3 @anagrius Remove any mention of the plugins from the README.
anagrius authored
106 This build setup is made for Gradle 1.0-milestone-6.
7ff7b05 @anagrius Initial attempt at a general Gradle project layout.
anagrius authored
107
d536a2f @anagrius Enabled subproject 2 by default.
anagrius authored
108 If you want to run the Scala subproject you will need to have install a
109 version of Scala.
Something went wrong with that request. Please try again.