Skip to content
This repository was archived by the owner on Sep 4, 2018. It is now read-only.

Commit f1e1ecd

Browse files
committed
Merge pull request #82 from UESTC-ACM/master
Release: v2.1.0
2 parents 253019d + 03fe864 commit f1e1ecd

File tree

1,479 files changed

+366624
-36495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,479 files changed

+366624
-36495
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ nohup.out
77
trunk/build/
88
/.idea
99
*.iml
10+
/out
11+
*.ipr
12+
*.iws

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44
[submodule "trunk/src/main/webapp/plugins/MathJax"]
55
path = trunk/src/main/webapp/plugins/MathJax
66
url = https://github.com/mathjax/MathJax.git
7-
[submodule "trunk/src/main/webapp/plugins/cdoj"]
8-
path = trunk/src/main/webapp/plugins/cdoj
9-
url = https://github.com/UESTC-ACM/CDOJ-UI.git

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: java
2+
jdk:
3+
- openjdk7
4+
5+
install:
6+
- cd trunk
7+
8+
script:
9+
- gradle -PdbUser=travis -PdbPassword="" build
10+

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# UESTC ACM/ICPC Online Judge
22

3-
## Notice
4-
- Please use [`maven 3`](http://maven.apache.org/) to test the web application, and the `JAVA_HOME` must be set in maven's `settings.xml` configuration file(A sample file is in `doc` folder). Please [click here](http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html) for more details.
3+
[![Build Status](https://travis-ci.org/UESTC-ACM/CDOJ.png?branch=master)](https://travis-ci.org/UESTC-ACM/CDOJ)
54

6-
- MySQL version should be greater than 5.1 and the db configuration file is located in `trunk/src/main/resources/resources.properties`.
5+
project home page: [http://uestc-acm.github.io/CDOJ](http://uestc-acm.github.io/CDOJ)
76

doc/cdoj.mwb

3.32 KB
Binary file not shown.

doc/cdojtest.mwb

47.4 KB
Binary file not shown.

trunk/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
/gradle
2020
/gradlew
2121
/gradlew.bat
22+
/gradle-app.setting
2223

trunk/build.gradle

Lines changed: 162 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
apply plugin: 'java'
2-
apply plugin: 'maven'
2+
apply plugin: 'war'
33
apply plugin: 'jetty'
4+
apply plugin: 'checkstyle'
5+
apply plugin: 'jacoco'
6+
apply plugin: 'idea'
47

58
group = 'cn.edu.uestc.acmicpc'
69
version = '2.0'
@@ -10,62 +13,170 @@ description = """UESTC Online Judge"""
1013
sourceCompatibility = 1.7
1114
targetCompatibility = 1.7
1215

16+
[jettyRunWar, jettyRun]*.contextPath = '/'
17+
project.stopPort = 8005
18+
project.stopKey = 'stop'
19+
20+
task checkControllerDoNotContainDaos(type: Exec) {
21+
commandLine "python", "src/test/python/check_controller_not_contain_daos.py"
22+
}
23+
24+
task checkDtosDoNotContainEntities(type: Exec) {
25+
commandLine "python", "src/test/python/check_dtos_not_contain_entities.py"
26+
}
27+
28+
task checkTestingCodeAllDoNotUseJunit(type: Exec) {
29+
commandLine "python", "src/test/python/check_testing_code_all_not_use_junit.py"
30+
}
31+
32+
task createSchema(type: Exec) {
33+
if (dbPassword == "") {
34+
commandLine "mysql", "-u$dbUser"
35+
} else {
36+
commandLine "mysql", "-u$dbUser", "-p$dbPassword"
37+
}
38+
standardInput = new FileInputStream(new File("src/test/sql/uestcojtest.sql"))
39+
}
40+
41+
task generateData(type: Exec) {
42+
if (dbPassword == "") {
43+
commandLine "mysql", "-u$dbUser"
44+
} else {
45+
commandLine "mysql", "-u$dbUser", "-p$dbPassword"
46+
}
47+
standardInput = new FileInputStream(new File("src/test/sql/uestcojtest-data0.sql"))
48+
}
49+
50+
task generateMainPropertyFile(type: Exec) {
51+
commandLine "bash", "scripts/configure_project.sh",
52+
"src/main/resources/resources.properties.template",
53+
"src/main/resources/resources.properties",
54+
"$dbUser", "$dbPassword"
55+
}
56+
57+
task generateTestPropertyFile(type: Exec) {
58+
commandLine "bash", "scripts/configure_project.sh",
59+
"src/test/resources/resources.properties.template",
60+
"src/test/resources/resources.properties",
61+
"$dbUser", "$dbPassword"
62+
}
63+
64+
task cleanResources << {
65+
delete "src/main/resources/resources.properties"
66+
delete "src/test/resources/resources.properties"
67+
}
68+
69+
compileJava.dependsOn(checkControllerDoNotContainDaos)
70+
compileJava.dependsOn(checkDtosDoNotContainEntities)
71+
compileJava.dependsOn(checkTestingCodeAllDoNotUseJunit)
72+
compileJava.dependsOn(createSchema)
73+
compileJava.dependsOn(generateData)
74+
generateData.dependsOn(createSchema)
75+
compileJava.dependsOn(generateMainPropertyFile)
76+
compileJava.dependsOn(generateTestPropertyFile)
77+
clean.dependsOn(cleanResources)
78+
79+
configurations {
80+
provided
81+
}
82+
83+
sourceSets {
84+
main.compileClasspath += configurations.provided
85+
test.compileClasspath += configurations.provided
86+
test.runtimeClasspath += configurations.provided
87+
}
88+
1389
repositories {
1490
mavenCentral();
1591
}
1692

1793
dependencies {
18-
compile group: 'org.ow2.asm', name: 'asm', version:'4.1'
19-
compile group: 'org.ow2.asm', name: 'asm-tree', version:'4.1'
20-
compile group: 'org.ow2.asm', name: 'asm-analysis', version:'4.1'
21-
compile group: 'org.ow2.asm', name: 'asm-util', version:'4.1'
22-
compile group: 'org.springframework', name: 'spring-core', version:'4.0.0.RELEASE'
23-
compile group: 'org.springframework', name: 'spring-expression', version:'4.0.0.RELEASE'
24-
compile group: 'org.springframework', name: 'spring-beans', version:'4.0.0.RELEASE'
25-
compile group: 'org.springframework', name: 'spring-aop', version:'4.0.0.RELEASE'
26-
compile group: 'org.springframework', name: 'spring-context', version:'4.0.0.RELEASE'
27-
compile group: 'org.springframework', name: 'spring-context-support', version:'4.0.0.RELEASE'
28-
compile group: 'org.springframework', name: 'spring-tx', version:'4.0.0.RELEASE'
29-
compile group: 'org.springframework', name: 'spring-jdbc', version:'4.0.0.RELEASE'
30-
compile group: 'org.springframework', name: 'spring-orm', version:'4.0.0.RELEASE'
31-
compile group: 'org.springframework', name: 'spring-oxm', version:'4.0.0.RELEASE'
32-
compile group: 'org.springframework', name: 'spring-web', version:'4.0.0.RELEASE'
33-
compile group: 'org.springframework', name: 'spring-webmvc', version:'4.0.0.RELEASE'
34-
compile group: 'org.springframework', name: 'spring-webmvc-portlet', version:'4.0.0.RELEASE'
35-
compile group: 'cglib', name: 'cglib', version:'2.2.2'
36-
compile group: 'aopalliance', name: 'aopalliance', version:'1.0'
37-
compile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.1.0.M0'
38-
compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.1.0.M0'
39-
compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version:'9.1.0.M0'
40-
compile group: 'org.eclipse.jetty', name: 'jetty-servlets', version:'9.1.0.M0'
41-
compile group: 'org.eclipse.jetty', name: 'jetty-jsp', version:'9.1.0.M0'
42-
compile group: 'org.eclipse.jetty', name: 'jetty-util', version:'9.1.0.M0'
43-
compile group: 'javax.servlet', name: 'jstl', version:'1.2'
44-
compile group: 'opensymphony', name: 'sitemesh', version:'2.4.2'
45-
compile group: 'org.hibernate', name: 'hibernate-validator', version:'4.2.0.Final'
46-
compile group: 'org.hibernate', name: 'hibernate-core', version:'4.3.0.Final'
47-
compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.22'
48-
compile group: 'com.jolbox', name: 'bonecp', version:'0.8.0-rc1'
49-
compile group: 'org.aspectj', name: 'aspectjweaver', version:'1.7.1'
50-
compile group: 'org.aspectj', name: 'aspectjrt', version:'1.7.1'
51-
compile group: 'com.alibaba', name: 'fastjson', version:'1.1.38'
52-
compile group: 'log4j', name: 'log4j', version:'1.2.17'
53-
compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.7.5'
54-
compile group: 'javax.servlet', name: 'jsp-api', version:'2.0'
55-
compile group: 'net.sourceforge.jexcelapi', name: 'jxl', version:'2.6.12'
56-
compile group: 'commons-io', name: 'commons-io', version:'1.3.2'
57-
compile group: 'commons-fileupload', name: 'commons-fileupload', version:'1.3'
58-
compile group: 'commons-lang', name: 'commons-lang', version:'2.0'
59-
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.1'
60-
compile group: 'javax.servlet', name: 'servlet-api', version:'3.0-alpha-1'
61-
compile group: 'javax.mail', name: 'mail', version:'1.5.0-b01'
62-
compile group: 'com.sun.mail', name: 'smtp', version:'1.5.0'
63-
testCompile group: 'org.springframework', name: 'spring-test', version:'4.0.0.RELEASE'
64-
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version:'1.3'
65-
testCompile group: 'com.jayway.jsonpath', name: 'json-path', version:'0.8.1'
94+
final asmGroup = 'org.ow2.asm'
95+
final asmVersion = '4.1'
96+
compile "$asmGroup:asm:$asmVersion"
97+
compile "$asmGroup:asm-analysis:$asmVersion"
98+
compile "$asmGroup:asm-tree:$asmVersion"
99+
compile "$asmGroup:asm-util:$asmVersion"
100+
101+
final springGroup = 'org.springframework'
102+
final springVersion = '4.0.0.RELEASE'
103+
compile "$springGroup:spring-core:$springVersion"
104+
compile "$springGroup:spring-expression:$springVersion"
105+
compile "$springGroup:spring-beans:$springVersion"
106+
compile "$springGroup:spring-aop:$springVersion"
107+
compile "$springGroup:spring-context:$springVersion"
108+
compile "$springGroup:spring-context-support:$springVersion"
109+
compile "$springGroup:spring-tx:$springVersion"
110+
compile "$springGroup:spring-jdbc:$springVersion"
111+
compile "$springGroup:spring-orm:$springVersion"
112+
compile "$springGroup:spring-oxm:$springVersion"
113+
compile "$springGroup:spring-web:$springVersion"
114+
compile "$springGroup:spring-webmvc:$springVersion"
115+
compile "$springGroup:spring-webmvc-portlet:$springVersion"
116+
117+
compile "cglib:cglib:2.2.2"
118+
compile "aopalliance:aopalliance:1.0"
119+
compile "javax.servlet:jstl:1.2"
120+
compile "com.jolbox:bonecp:0.8.0-rc1"
121+
compile "com.alibaba:fastjson:1.1.38"
122+
123+
final jettyGroup = 'org.eclipse.jetty'
124+
final jettyVersion = '9.1.0.M0'
125+
compile "$jettyGroup:jetty-server:$jettyVersion"
126+
compile "$jettyGroup:jetty-servlet:$jettyVersion"
127+
compile "$jettyGroup:jetty-webapp:$jettyVersion"
128+
compile "$jettyGroup:jetty-servlets:$jettyVersion"
129+
compile "$jettyGroup:jetty-jsp:$jettyVersion"
130+
compile "$jettyGroup:jetty-util:$jettyVersion"
131+
132+
final hibernateGroup = 'org.hibernate'
133+
final hibernateVersion = '4.2.0.Final'
134+
compile "$hibernateGroup:hibernate-core:$hibernateVersion"
135+
compile "$hibernateGroup:hibernate-validator:$hibernateVersion"
136+
compile "mysql:mysql-connector-java:5.1.22"
137+
138+
final aspectjGroup = 'org.aspectj'
139+
final aspectjVersion = '1.7.1'
140+
compile "$aspectjGroup:aspectjweaver:$aspectjVersion"
141+
compile "$aspectjGroup:aspectjrt:$aspectjVersion"
142+
143+
compile "log4j:log4j:1.2.17"
144+
compile "org.slf4j:slf4j-log4j12:1.7.5"
145+
146+
compile "net.sourceforge.jexcelapi:jxl:2.6.12"
147+
compile "commons-io:commons-io:1.3.2"
148+
compile "commons-fileupload:commons-fileupload:1.3"
149+
compile "commons-lang:commons-lang:2.0"
150+
compile "org.apache.commons:commons-lang3:3.1"
151+
compile "javax.mail:mail:1.5.0-b01"
152+
compile "com.sun.mail:smtp:1.5.0"
153+
154+
testCompile "$springGroup:spring-test:$springVersion"
155+
testCompile "org.hamcrest:hamcrest-all:1.3"
156+
testCompile "com.jayway.jsonpath:json-path:0.8.1"
66157
testCompile(group: 'junit', name: 'junit', version:'4.11') {
67158
exclude(module: 'hamcrest-core')
68159
}
69-
testCompile group: 'org.testng', name: 'testng', version:'6.1.1'
70-
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
160+
testCompile "org.testng:testng:6.1.1"
161+
testCompile "org.mockito:mockito-all:1.9.5"
162+
163+
provided "javax.servlet:jsp-api:2.0"
164+
provided "org.glassfish:javax.servlet:3.0"
165+
provided "javax.servlet:servlet-api:3.0-alpha-1"
166+
}
167+
168+
test {
169+
doFirst {
170+
jettyRun.daemon = true
171+
jettyRun.execute()
172+
}
173+
doLast {
174+
jettyStop.execute()
175+
}
176+
useTestNG()
71177
}
178+
179+
jacoco {
180+
toolVersion = "0.6.5.201403032054"
181+
}
182+
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
<module name="AvoidStarImport">
1515
</module>
1616
<module name="ImportOrder">
17-
<property name="groups" value="/^javax?\./,org,cn.edu,*"/>
17+
<property name="groups" value="cn.edu.uestc.acmicpc,org,*,/^javax?\./,"/>
1818
<property name="ordered" value="true"/>
1919
<property name="option" value="top"/>
20+
<property name="separated" value="true"/>
2021
</module>
2122
<module name="RedundantImport"/>
2223
<module name="UnusedImports">

trunk/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dbUser = root
2+
dbPassword = root

0 commit comments

Comments
 (0)