Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*.war
*.zip

build
target

.idea
.vscode
.gradle

!/.mvn/wrapper/maven-wrapper.jar
!/gradle/wrapper/gradle-wrapper.jar
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ dist: trusty
jdk:
- oraclejdk8

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

before_script:
- scripts/lint-docs.sh

script:
- echo 'todo'
36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
allprojects {

apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'checkstyle'

group = 'org.ridelab'
version = '0.0.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8

[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'

}

subprojects {

repositories {
mavenCentral()
}

configurations {}

dependencies {
compile 'org.projectlombok:lombok:1.16.18'
compileOnly 'org.jetbrains:annotations:15.0'
testCompile 'junit:junit:4.12'
}

checkstyle {
toolVersion = '8.5'
configFile = rootProject.file 'config/checkstyle/checkstyle.xml'
}

}
4 changes: 4 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies {
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'org.apache.commons:commons-lang3:3.7'
}
46 changes: 46 additions & 0 deletions common/src/main/java/org/ridelab/bms/common/five/Five.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.ridelab.bms.common.five;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import lombok.experimental.UtilityClass;

/**
* A library to overcomplicate 5.
*
* @see <a href="https://github.com/jackdclark/five">five</a>
*/
@UtilityClass
@FieldDefaults(level = AccessLevel.PUBLIC)
public class Five {

int five() {
return 5;
}

boolean isFive(int n) {
return five() == n;
}

String esperanto() {
return "kvin";
}

String greek() {
return "πέντε";
}

String pinyin() {
return "wǔ";
}

String morseCode() {
return ".....";
}

String oclock() {
// CHECKSTYLE:OFF
return "\uD83D\uDD54";
// CHECKSTYLE:ON
}

}
32 changes: 32 additions & 0 deletions common/src/test/java/org/ridelab/bms/common/five/FiveTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.ridelab.bms.common.five;

import org.apache.commons.lang3.StringUtils;
import org.junit.Test;

import static org.junit.Assert.*;

public class FiveTest {

@Test
public void five() {
assertEquals(5, Five.five());
}

@Test
public void isFive() {
assertTrue(Five.isFive(5));
assertFalse(Five.isFive(6));
}

@Test
public void multilingual() {
assertTrue(StringUtils.isNoneBlank(
Five.esperanto(),
Five.greek(),
Five.pinyin(),
Five.morseCode(),
Five.oclock()
));
}

}
Loading