Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 7db978d

Browse files
author
Aleksi Salmela
committed
Merge branch 'master' into improvements-aleksi
2 parents d09aa73 + 3ac0533 commit 7db978d

File tree

68 files changed

+707
-720
lines changed

Some content is hidden

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

68 files changed

+707
-720
lines changed

.travis.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
language: java
2-
32
script:
4-
- mvn checkstyle:check cobertura:cobertura test
5-
3+
- mvn -Dsurefire.rerunFailingTestsCount=3 cobertura:cobertura test
4+
- mvn checkstyle:check
65
after_success:
76
- mvn coveralls:report
7+
- mvn clean package
8+
jdk:
9+
- oraclejdk8
10+
- oraclejdk7
11+
cache:
12+
directories:
13+
- "$HOME/.m2"
14+
deploy:
15+
skip_cleanup: true
16+
provider: releases
17+
api_key:
18+
secure: i6ROBH72AVNV6ywsYdgMdVyAGGp6kSTTVMqBT/ZUwbSUrRhNYowbfT2MeBcoeIZNbCl8AC8EWOtqmyTKseQp2bMP1nIl+5TwjXwqmdxsV+/Ldq14z1fH5iZzF+KDF/gQvXRbqJvHzfBxw9l/R8jbgRCjD7GNmn+J7fbQz2yV/fTw9R+LBpMDdE6EDCCndsbsIFmug1/EOSzgagkEQMbyJ99+FiKsp+HvcHYX5ToRXeYfGibX+YGGNeMpiktNZUdmatK0LoryTv9iO3SGVWT+x9Hy2/Ckj7VmRYwcgw+3Iao4pnxaLJxqQ2G8I82KuZZ5+NfOysClmxnZh7EqOOOodUUWdW+CnkeiHkIgpfobBIQUb4LA0d26KJ6nJJpal5ae/DxagrhFR9Oac4BNiRmpBZc6lg25gUo9JHwlZssCVii+43ftF6our9x5rm4T/6h/KWCzRx1MHOoiq7t2UUa0nQ2kI1bISyogwPj8kECyvG6otp/G/MBlfmwTd3yHfe/1qig4QKd0K8hgdkPLAR1e/9ImILeIG/cbK1zDthdoUi1623MBxP7SXyIfcLlX2SKqSjZgCV1iZEeFRmzecwJYEHQE4Cy7sozcGUEzkLz76jOOWleECVKSp97/RfblK7V9lEfV1A8gk1u6rbxhbsMhQcAkiw+cQbl9uPTLTafYsnM=
19+
file_glob: true
20+
file:
21+
- tmc
22+
- target/tmc-cli-*.jar
23+
on:
24+
repo: testmycode/tmc-cli
25+
tags: true
26+
jdk: oraclejdk8

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
[![Build Status](https://travis-ci.org/tmc-cli/tmc-cli.svg?branch=master)](https://travis-ci.org/tmc-cli/tmc-cli)
3-
[![GitHub release](https://img.shields.io/badge/release-latest-brightgreen.svg?style=flat)](https://github.com/tmc-cli/tmc-cli/releases/latest)
4-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/tmc-cli/tmc-cli/master/LICENSE)
5-
[![Coverage Status](https://coveralls.io/repos/github/tmc-cli/tmc-cli/badge.svg?branch=master)](https://coveralls.io/github/tmc-cli/tmc-cli?branch=master)
6-
[![Build status](https://ci.appveyor.com/api/projects/status/np29sxc72y2f7d57?svg=true)](https://ci.appveyor.com/project/mikkomaa/tmc-cli)
2+
[![Build Status](https://travis-ci.org/testmycode/tmc-cli.svg?branch=master)](https://travis-ci.org/testmycode/tmc-cli)
3+
[![GitHub release](https://img.shields.io/badge/release-latest-brightgreen.svg?style=flat)](https://github.com/testmycode/tmc-cli/releases/latest)
4+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/testmycode/tmc-cli/master/LICENSE)
5+
[![Coverage Status](https://coveralls.io/repos/github/tmc-cli/tmc-cli/badge.svg?branch=master)](https://coveralls.io/github/testmycode/tmc-cli?branch=master)
6+
[![Build status](https://ci.appveyor.com/api/projects/status/js9jr4ef4o7dnama?svg=true)](https://ci.appveyor.com/project/jamox/tmc-cli-08d2u)
77

8-
![tmc-cli logo](https://rawgit.com/tmc-cli/tmc-cli/master/docs/logo_plain.svg)
8+
![tmc-cli logo](https://rawgit.com/testmycode/tmc-cli/master/docs/logo_plain.svg)
99

1010
#tmc-cli
1111

@@ -28,14 +28,14 @@ TMC-CLI is the command-line client for University of Helsinki's TestMyCode -fram
2828
`cd` into the directory where you wish to install TMC-CLI. Then, copy and paste the following command in your terminal:
2929

3030
```
31-
curl -0 https://raw.githubusercontent.com/tmc-cli/tmc-cli/master/scripts/install.sh | bash; source ~/.bashrc
31+
curl -0 https://raw.githubusercontent.com/testmycode/tmc-cli/master/scripts/install.sh | bash; source ~/.bashrc
3232
```
3333

3434
TMC-CLI should now be installed. You can try running it with `tmc`.
3535

3636
###Manual installation
3737

38-
Download the latest [release](https://github.com/tmc-cli/tmc-cli/releases/latest). If you use Linux or OS X, choose "tmc". If you use Windows, choose "tmc-cli-[VERSION].jar".
38+
Download the latest [release](https://github.com/testmycode/tmc-cli/releases/latest). If you use Linux or OS X, choose "tmc". If you use Windows, choose "tmc-cli-[VERSION].jar".
3939

4040
If you downloaded "tmc", navigate to the download directory on your terminal and make it executable with `chmod u+x ./tmc`.
4141

@@ -173,8 +173,19 @@ https://link.to.paste/bin
173173

174174
You cannot submit exercises that you have completed.
175175

176+
# Contribute
177+
178+
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
179+
2. Install the dependencies: `mvn dependency:go-offline`
180+
3. Build the code : `mvn package`
181+
4. Run the tests : `mvn test`
182+
5. Run the checkstyle : `mvn checkstyle:check`
183+
184+
## Crafting a release
185+
Releases are automatically built in Travis and pushed to GitHub releases. Once ready to release, update version in pom.xml and gat the commit accordingly. Once tests have passed a new release is uploaded to travis. Note: only travis runs with tag set are used for releases.
186+
176187
##Disclaimer
177188

178-
This software is licensed under [the MIT license](https://raw.githubusercontent.com/tmc-cli/tmc-cli/instructions/LICENSE).
189+
This software is licensed under [the MIT license](https://raw.githubusercontent.com/testmycode/tmc-cli/instructions/LICENSE).
179190

180191
This software comes with no warranty. University of Helsinki and the tmc-cli developers are not responsible for any damages caused by misuse or misbehaviour of this software.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>fi.helsinki.cs.tmc.cli</groupId>
55
<artifactId>tmc-cli</artifactId>
6-
<version>0.7.1</version>
6+
<version>0.7.6</version>
77
<packaging>jar</packaging>
88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -36,7 +36,7 @@
3636
<dependency>
3737
<groupId>fi.helsinki.cs.tmc</groupId>
3838
<artifactId>core</artifactId>
39-
<version>0.5.2-SNAPSHOT</version>
39+
<version>0.8.3-SNAPSHOT</version>
4040
</dependency>
4141
<dependency>
4242
<groupId>commons-cli</groupId>

scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ -f $HOME/.tmc-autocomplete.sh ]; then
3131
fi
3232
fi
3333
echo "Fetching latest release URL"
34-
URL=$(curl -s https://api.github.com/repos/tmc-cli/tmc-cli/releases/latest | grep '"browser_download_url"' | grep '/tmc"' | head -n 1 | cut -d '"' -f 4)
34+
URL=$(curl -s https://api.github.com/repos/testmycode/tmc-cli/releases/latest | grep '"browser_download_url"' | grep '/tmc"' | head -n 1 | cut -d '"' -f 4)
3535
echo "Downloading TMC-CLI"
3636
curl -LO $URL > ./tmc
3737
if [ ! -f ./tmc ]; then

src/main/java/fi/helsinki/cs/tmc/cli/Application.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private String[] parseArgs(String[] args) {
109109
runCommand("help", new String[0]);
110110
return null;
111111
}
112-
runCommand(commandName, new String[]{"-h"});
112+
runCommand(commandName, new String[] {"-h"});
113113
return null;
114114
}
115115
if (showVersion) {
@@ -169,18 +169,16 @@ private boolean versionCheck() {
169169
}
170170

171171
Date now = new Date();
172-
if (previous != null && previous.getTime() + defaultUpdateInterval > now.getTime()) {
173-
return false;
174-
}
175-
176-
return runAutoUpdate();
172+
return !(previous != null && previous.getTime() + defaultUpdateInterval > now.getTime())
173+
&& runAutoUpdate();
177174
}
178175

179176
public boolean runAutoUpdate() {
180177
Map<String, String> properties = context.getProperties();
181178
Date now = new Date();
182-
AutoUpdater update = AutoUpdater.createUpdater(io,
183-
EnvironmentUtil.getVersion(), EnvironmentUtil.isWindows());
179+
AutoUpdater update =
180+
AutoUpdater.createUpdater(
181+
io, EnvironmentUtil.getVersion(), EnvironmentUtil.isWindows());
184182
boolean updated = update.run();
185183

186184
long timestamp = now.getTime();
@@ -196,11 +194,16 @@ public Color getColor(String propertyName) {
196194
Color color = ColorUtil.getColor(propertyValue);
197195
if (color == null) {
198196
switch (propertyName) {
199-
case "progressbar-left": return Color.CYAN;
200-
case "progressbar-right": return Color.CYAN;
201-
case "testresults-left": return Color.GREEN;
202-
case "testresults-right": return Color.RED;
203-
default: return Color.NONE;
197+
case "progressbar-left":
198+
return Color.CYAN;
199+
case "progressbar-right":
200+
return Color.CYAN;
201+
case "testresults-left":
202+
return Color.GREEN;
203+
case "testresults-right":
204+
return Color.RED;
205+
default:
206+
return Color.NONE;
204207
}
205208
}
206209
return color;

src/main/java/fi/helsinki/cs/tmc/cli/backend/Account.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Account {
1212
private String password;
1313

1414
// for gson
15-
public Account() { }
15+
public Account() {}
1616

1717
public Account(String serverAddress, String username, String password) {
1818
this.serverAddress = serverAddress;

src/main/java/fi/helsinki/cs/tmc/cli/backend/AccountList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public int getAccountCount() {
7575
return this.accountArray.size();
7676
}
7777

78-
public List<Account> getAccountList() {
78+
private List<Account> getAccountList() {
7979
return Collections.unmodifiableList(this.accountArray);
8080
}
8181

src/main/java/fi/helsinki/cs/tmc/cli/backend/CourseInfoIo.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static CourseInfo load(Path courseInfoFile) {
4444
//Return null if file is not found, this is normal behaviour
4545
return null;
4646
}
47-
Reader reader = null;
47+
Reader reader;
4848
try {
4949
reader = Files.newBufferedReader(courseInfoFile, Charset.forName("UTF-8"));
5050
} catch (IOException e) {
@@ -56,9 +56,7 @@ public static CourseInfo load(Path courseInfoFile) {
5656
}
5757

5858
public static void createNewCourse(Course course, Account account, Path parentDir) {
59-
Path configFile = parentDir
60-
.resolve(course.getName())
61-
.resolve(CourseInfoIo.COURSE_CONFIG);
59+
Path configFile = parentDir.resolve(course.getName()).resolve(CourseInfoIo.COURSE_CONFIG);
6260

6361
CourseInfo info = new CourseInfo(account, course);
6462
info.setExercises(course.getExercises());

src/main/java/fi/helsinki/cs/tmc/cli/backend/Settings.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,8 @@ public Path getConfigRoot() {
116116
}
117117

118118
@Override
119-
public void setCourse(Course course) {
120-
}
119+
public void setCourse(Course course) {}
121120

122121
@Override
123-
public void setConfigRoot(Path path) {
124-
}
122+
public void setConfigRoot(Path path) {}
125123
}

src/main/java/fi/helsinki/cs/tmc/cli/backend/SettingsIo.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static boolean savePropertiesTo(HashMap<String, String> properties, Path
9494
* Get the correct directory in which our config files go
9595
* ie /home/user/.config/tmc-cli/.
9696
*/
97-
protected static Path getConfigDirectory() {
97+
static Path getConfigDirectory() {
9898
Path configPath;
9999
if (EnvironmentUtil.isWindows()) {
100100
String appdata = System.getenv("APPDATA");
@@ -110,8 +110,7 @@ protected static Path getConfigDirectory() {
110110
if (configEnv != null && configEnv.length() > 0) {
111111
configPath = Paths.get(configEnv);
112112
} else {
113-
configPath = Paths.get(System.getProperty("user.home"))
114-
.resolve(".config");
113+
configPath = Paths.get(System.getProperty("user.home")).resolve(".config");
115114
}
116115
}
117116
return configPath.resolve(CONFIG_DIR);

0 commit comments

Comments
 (0)