-
Notifications
You must be signed in to change notification settings - Fork 11
/
developer.txt
98 lines (80 loc) · 3.37 KB
/
developer.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Project code style:
- Ensure that the licence code is at the top of new files (see below)
- encoding UTF-8
- indentation: 4 spaces
- tab size: 4 spaces
- expand tabs to spaces
- right margin: 160
- beginning brace on same line as declaration
- no new line for else, while, catch, finally
- use whitespace around assignment and comparators
- only a single declaration per line
- always use braces for conditional statements and looping; even if only contains a single statement
- use blank lines and spaces to assist in readability
- comment logic that isn't straight forward
------- Example -------
package com.my.package;
import java.util.List;
public class MyClass {
private String memberAttribute;
private String blahString;
public MyClass {
}
public void methodA() {
// can use inline comments where necessary
if (memberAttribute == null) {
memberAttribute = "blah";
}
}
public int methodB(List<String> someList) {
int count = 0;
for (String s : someList) {
if (s.contains("abc")) {
count++;
} else {
System.out.println(s);
}
}
return count;
}
}
----- License Code (Put at the top of each file -----
/* Copyright (c) 2004-2016 YAMJ Members
* https://github.com/orgs/YAMJ/people
*
* This file is part of the Yet Another Media Jukebox (YAMJ).
*
* The YAMJ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* YAMJ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the YAMJ. If not, see <http://www.gnu.org/licenses/>.
*
*/ Web: https://github.com/YAMJ/yamj-v2
----- Eclipse Integration -----
Use the m2eclipse plugin to manage the project under eclipse.
Instructions to install the eclipse plugin: http://m2eclipse.sonatype.org/installing-m2eclipse.html
A maven version is embedded in it.
----- Compilation -----
Use maven 3.x to compile the project from command line (http://maven.apache.org/download.html)
From the command line the principal goals are:
- mvn clean : to clean the project
- mvn compile : to compile the sources
- mvn test : to compile the sources, the tests, and execute the tests
- mvn package : to create the package(s) (.jar, .zip, etc...)
- mvn install : to install the package(s) in local repository
- mvn deploy : to deploy the package(s) to the oss.sonatype repository
If you want to skip the tests set the maven.test.skip property to true before the goal. Example:
- mvn -Dmaven.test.skip=true package
In eclipse create a new "Run As" configuration (Run/Run Configurations). Then create a new Maven Build (name it 'package without test' for example)
and check the 'Skip Tests' option.
If you have problems executing the plugin like sonar, try to increase memory heap:
[Windows] set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=256m
[Unix/OSX] export MAVEN_OPT=S'-Xmx512m -XX:MaxPermSize=256m'