Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
fcc605b
checking a new branch
OHopiak Jan 7, 2018
799791a
Add locale to the project and started making a new GUI
OHopiak Jan 8, 2018
97799dc
Merge remote-tracking branch 'origin/dev' into dev
OHopiak Jan 8, 2018
153d5b9
added java coverage support
OHopiak Jan 8, 2018
8cd0974
Added coverage support
OHopiak Jan 8, 2018
34413f8
updated travis config
OHopiak Jan 8, 2018
e52a02a
updated travis config
OHopiak Jan 8, 2018
362ca9e
Add locale to the project and started making a new GUI
OHopiak Jan 9, 2018
c555c8c
Merge remote-tracking branch 'origin/dev' into dev
OHopiak Jan 9, 2018
cf9d3e8
added a Dockerfile to run as node
OHopiak Jan 10, 2018
dee0c4b
Running in a docker node
OHopiak Jan 10, 2018
58cba2f
trying again to use Dockerfile
OHopiak Jan 11, 2018
730aee1
stopped using dockerfile
OHopiak Jan 11, 2018
115b7ff
checking another dockerfile
OHopiak Jan 11, 2018
864751b
Merge branch 'dev' of github.com:/OHopiak/FastChat into dev
OHopiak Jan 11, 2018
23e443d
testing another method of running in docker
OHopiak Jan 11, 2018
ade6989
...
OHopiak Jan 11, 2018
caf39ff
another docker runner
OHopiak Jan 11, 2018
9053fe7
fixed dockerfile
OHopiak Jan 11, 2018
ec5a107
Added Jenkinsfile
OHopiak Jan 11, 2018
1c9287f
fix Jenkinsfile
OHopiak Jan 11, 2018
16be2f0
add a deploy script execution to Jenkinsfile
OHopiak Jan 11, 2018
717da59
updated deploy script
OHopiak Jan 11, 2018
f082c96
Merge branch 'dev' of github.com:/OHopiak/FastChat into dev
OHopiak Jan 11, 2018
7a41774
mistake in deploy script
OHopiak Jan 11, 2018
ffccce2
forgot to build javadoc
OHopiak Jan 11, 2018
cdc6299
Changed client structure to use interfaces
OHopiak Feb 4, 2018
7be9681
Fixed Online Users tab, added Window Icon
OHopiak Feb 4, 2018
3c43815
Merge remote-tracking branch 'origin/dev' into dev
OHopiak Feb 4, 2018
7e39b5a
fix version in build.gradle
OHopiak Feb 4, 2018
06b2dfb
New Classes(Command and CommandRegistry) and their implementation in …
Roman6917 Mar 3, 2018
061c064
New Classes(Command and CommandRegistry) and their implementation in …
Roman6917 Mar 3, 2018
a04315c
Delete variable and useless comments
Roman6917 Mar 3, 2018
f7548db
Merge branch 'dev' into _addingCommandClass
OHopiak Mar 3, 2018
a50d3e0
Merge pull request #2 from OHopiak/_addingCommandClass
OHopiak Mar 3, 2018
e8a4b4a
slight refactoring
OHopiak Mar 4, 2018
292c4de
Added TODOs
OHopiak Mar 15, 2018
18b606c
fix for TODOs
OHopiak Mar 15, 2018
2abc083
added a NetworkCommand class and Registry for it
OHopiak Mar 31, 2018
3d53c3e
Refactored hardcoded network connections
OHopiak Apr 1, 2018
51cb9ac
Merge pull request #3 from OHopiak/adding-network-protocol
OHopiak Apr 1, 2018
93d0f78
Moved connection to TCP
OHopiak Apr 1, 2018
0fdc4b6
added CodeCov badge
OHopiak Apr 1, 2018
bcfc366
Merge branch 'master' into dev
OHopiak Apr 1, 2018
b13c288
adding deploy to travis config
OHopiak Apr 3, 2018
af60a24
separated OnlineUsers to the interface, fixed bug with cropping first…
OHopiak Apr 6, 2018
d87d2bb
Merge pull request #4 from OHopiak/moving-to-tcp
OHopiak Apr 6, 2018
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ gradle
gradlew
gradlew.bat
build
.gradletasknamecache

#TestNG
test-output

17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
language: java

cache: gradle

jdk:
- oraclejdk8

env:
global:
- GH_REPO_NAME: FastChat
- GH_REPO_REF: github.com/OHopiak/FastChat.git

script:
- gradle assemble
- gradle check jacocoTestReport
- gradle build javadoc

after_success:
- bash <(curl -s https://codecov.io/bash)
- cd $TRAVIS_BUILD_DIR
- ./scripts/deploy-travis
93 changes: 27 additions & 66 deletions FastChat.uml
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,40 @@
<ID>JAVA</ID>
<OriginalElement />
<nodes>
<node x="200.7759259259259" y="990.0">com.fastchat.FastChat.Loader</node>
<node x="311.68333333333334" y="704.0">com.fastchat.FastChat.client.Login</node>
<node x="458.575" y="0.0">com.fastchat.FastChat.client.Client</node>
<node x="202.00000000000003" y="526.0">com.fastchat.FastChat.server.Server.Status</node>
<node x="18.683333333333337" y="668.0">com.fastchat.FastChat.server.Server</node>
<node x="222.575" y="180.0">com.fastchat.FastChat.client.OnlineUsers</node>
<node x="0.0" y="478.0">com.fastchat.FastChat.server.ServerClient</node>
<node x="324.18333333333334" y="466.0">com.fastchat.FastChat.client.ClientWindow</node>
<node x="112.5" y="82.0">com.fastchat.FastChat.Loader</node>
<node x="144.0" y="0.0">com.fastchat.FastChat.client</node>
<node x="283.0" y="0.0">com.fastchat.FastChat.util</node>
<node x="0.0" y="207.0">com.fastchat.FastChat.networking</node>
<node x="0.0" y="0.0">com.fastchat.FastChat.server</node>
<node x="201.0" y="207.0">com.fastchat.FastChat.beans</node>
</nodes>
<notes />
<edges>
<edge source="com.fastchat.FastChat.client.Login" target="com.fastchat.FastChat.client.ClientWindow">
<point x="-109.5" y="-100.0" />
<point x="348.18333333333334" y="643.0" />
<point x="356.51666666666665" y="643.0" />
<point x="-64.66666666666669" y="76.0" />
</edge>
<edge source="com.fastchat.FastChat.Loader" target="com.fastchat.FastChat.client.Login">
<point x="45.5" y="-52.0" />
<point x="337.2759259259259" y="965.0" />
<point x="457.68333333333334" y="965.0" />
<point x="0.0" y="100.0" />
</edge>
<edge source="com.fastchat.FastChat.client.ClientWindow" target="com.fastchat.FastChat.client.OnlineUsers">
<point x="-24.25" y="-76.0" />
<point x="396.93333333333334" y="446.0" />
<point x="384.575" y="446.0" />
<point x="54.0" y="28.0" />
</edge>
<edge source="com.fastchat.FastChat.client.Client" target="com.fastchat.FastChat.client.Login">
<point x="89.0" y="208.0" />
<point x="681.075" y="446.0" />
<point x="619.8675925925926" y="446.0" />
<point x="619.8675925925926" y="643.0" />
<point x="567.1833333333334" y="643.0" />
<point x="109.50000000000001" y="-100.0" />
</edge>
<edge source="com.fastchat.FastChat.Loader" target="com.fastchat.FastChat.server.Server">
<point x="-45.5" y="-52.0" />
<point x="246.2759259259259" y="965.0" />
<point x="155.18333333333334" y="965.0" />
<point x="0.0" y="136.0" />
</edge>
<edge source="com.fastchat.FastChat.server.Server" target="com.fastchat.FastChat.server.ServerClient">
<point x="-54.60000000000002" y="-136.0" />
<point x="100.58333333333331" y="643.0" />
<point x="91.0" y="643.0" />
<point x="0.0" y="64.0" />
</edge>
<edge source="com.fastchat.FastChat.server.Server" target="com.fastchat.FastChat.server.Server.Status">
<point x="54.60000000000002" y="-136.0" />
<point x="209.78333333333336" y="643.0" />
<point x="224.00000000000003" y="643.0" />
<point x="-22.0" y="16.0" />
</edge>
<edge source="com.fastchat.FastChat.client.ClientWindow" target="com.fastchat.FastChat.client.Client">
<point x="24.25" y="-76.0" />
<point x="445.43333333333334" y="436.0" />
<point x="503.075" y="436.0" />
<point x="-89.0" y="208.0" />
</edge>
<edge source="com.fastchat.FastChat.server.Server.Status" target="com.fastchat.FastChat.server.Server">
<point x="22.0" y="16.0" />
<point x="268.0" y="643.0" />
<point x="264.3833333333334" y="643.0" />
<point x="109.20000000000005" y="-136.0" />
<edge source="com.fastchat.FastChat.Loader" target="com.fastchat.FastChat.server">
<point x="-68.25" y="-40.0" />
<point x="135.25" y="57.0" />
<point x="62.0" y="57.0" />
<point x="0.0" y="16.0" />
</edge>
<edge source="com.fastchat.FastChat.Loader" target="com.fastchat.FastChat.util">
<point x="68.25" y="-40.0" />
<point x="271.75" y="57.0" />
<point x="336.0" y="57.0" />
<point x="0.0" y="16.0" />
</edge>
<edge source="com.fastchat.FastChat.Loader" target="com.fastchat.FastChat.client">
<point x="-22.75" y="-40.0" />
<point x="180.75" y="57.0" />
<point x="173.75" y="57.0" />
<point x="-29.75" y="16.0" />
</edge>
</edges>
<settings layout="Hierarchic Group" zoom="1.134313725490196" x="403.18323249783924" y="719.2333621434746" />
<SelectedNodes />
<settings layout="Hierarchic Group" zoom="0.9494773519163763" x="245.0" y="277.0" />
<SelectedNodes>
<node>com.fastchat.FastChat.server</node>
</SelectedNodes>
<Categories>
<Category>Methods</Category>
<Category>Inner Classes</Category>
</Categories>
<SCOPE>All</SCOPE>
<VISIBILITY>private</VISIBILITY>
Expand Down
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ pipeline {
}
stage('test') {
steps {
sh 'gradle test'
sh 'gradle check jacocoTestReport'
junit(testResults: '**/build/test-results/**/*.xml', allowEmptyResults: true)
jacoco(execPattern: '**/build/**.exec')
}
}
stage('deploy') {
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FastChat
========

Travis:
[![Build Status](https://travis-ci.org/OHopiak/FastChat.svg?branch=master)](https://travis-ci.org/OHopiak/FastChat)

Jenkins:
[![Build Status](http://18.194.57.194:8080/job/FastChat/job/master/4/badge/icon)](http://18.194.57.194:8080/job/FastChat/job/master/4/)
[![codecov](https://codecov.io/gh/OHopiak/FastChat/branch/dev/graph/badge.svg)](https://codecov.io/gh/OHopiak/FastChat)

This is the simple chatting tool
Feel free to contribute to this project

Requirements
------------
Expand Down
41 changes: 34 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'jacoco'

group = 'com.fastchat'
version = '0.0.1'
version = '0.0.3'

description = """FastChat - a tool for instant chatting that not always works as expected - WIP"""

sourceCompatibility = 1.8
targetCompatibility = 1.8


configurations {
libraries
}

jar {
manifest {
attributes(
Expand All @@ -18,6 +23,9 @@ jar {
)

}
from {
configurations.libraries.collect { it.isDirectory() ? it : zipTree(it) }
}
}

test {
Expand All @@ -26,15 +34,34 @@ test {
}

repositories {
maven { url "http://jcenter.bintray.com" }
maven { url "http://repo.maven.apache.org/maven2" }
jcenter()
}

dependencies {
testCompile group: 'org.testng', name: 'testng', version: '6.9.12'
libraries 'com.jgoodies:jgoodies-forms:1.6.0'
libraries 'com.google.code.gson:gson:2.8.2'
// libraries 'com.intellij:forms_rt:7.0.3'
testCompile 'org.testng:testng:6.9.12'
testCompile 'com.google.guava:guava:19.0'
configurations.compile.extendsFrom(configurations.libraries)
}

jacocoTestReport {
reports {
//noinspection GroovyAssignabilityCheck
html.enabled true
//noinspection GroovyAssignabilityCheck
xml.enabled true
//noinspection GroovyAssignabilityCheck
csv.enabled true
}
}

task printJarName{
javadoc {
failOnError = false
}

task printJarName {
dependsOn 'jar'
doLast {
println "${project.name}-${project.version}.jar"
Expand All @@ -46,4 +73,4 @@ task printArtifactsDirectory {
doLast {
println "${project.name}/${project.version}"
}
}
}
6 changes: 6 additions & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM gradle:latest

USER root
RUN mkdir /opt/artifacts && chown -R gradle:gradle /opt/artifacts
RUN apt update && apt install -y ssh
#USER gradle
8 changes: 4 additions & 4 deletions scripts/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ artifact_jar="build/libs/`gradle printJarName -q 2>/dev/null`"
artifact_docs="build/docs/javadoc"
artifact_tests="build/reports/tests/test"

mkdir -p $version_dir
cp -r $artifact_jar $version_dir
cp -r $artifact_docs $version_dir/docs
cp -r $artifact_tests $version_dir/tests
mkdir -p "$version_dir"
cp -r "$artifact_jar" "$version_dir"
cp -r "$artifact_docs" "$version_dir/docs"
cp -r "$artifact_tests" "$version_dir/tests"
70 changes: 70 additions & 0 deletions scripts/deploy-travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash

PROJECT_DIR=$(cd $(dirname "$0")/.. && echo "$PWD")
BUILD_DIR="$PROJECT_DIR/build"
GH_PAGES_DIR="$BUILD_DIR/gh-pages"
BRANCH=$(git branch | grep \* | cut -d ' ' -f2-)

if [ "$BRANCH" == "master" ]; then
DEPLOY_DIR="$GH_PAGES_DIR"
else
DEPLOY_DIR="$GH_PAGES_DIR/$BRANCH"
fi

set -ex

function copy_markdown(){
cp "$PROJECT_DIR"/*.md "$DEPLOY_DIR"
}

function deploy_dir(){
local dir=$1
if [ -d "$BUILD_DIR/$dir" ]; then
if [ -d "$DEPLOY_DIR/$dir" ]; then
rm -fr "$DEPLOY_DIR/$dir"
fi
cp -r "$BUILD_DIR/$dir" "$DEPLOY_DIR/$dir"
else
echo "Directory $dir doesn't exist"
fi
}

function set_up_git(){
# delete directory with pages if it exists
if [ -d "$GH_PAGES_DIR" ]; then
rm -fr "$GH_PAGES_DIR"
fi

git clone -b gh-pages "https://git@$GH_REPO_REF.git" "$GH_PAGES_DIR"

cd "$GH_PAGES_DIR"
git config --global push.default simple
git config user.name "Travis CI"
git config user.email "travis@travis-ci.org"
}

function push_changes(){
if ! git diff-index --quiet HEAD --; then
git add --all
git commit -m "Deploy code docs to GitHub Pages Travis build: ${TRAVIS_BUILD_NUMBER}" -m "Commit: ${TRAVIS_COMMIT}"
git push --force "https://${GH_REPO_TOKEN}@${GH_REPO_REF}" > /dev/null 2>&1
fi
}

function main(){
if [ ! -d "$PROJECT_DIR/build" ]; then
echo "You must build the project before deploying"
exit 1
fi

set_up_git
mkdir -p "$DEPLOY_DIR"
copy_markdown
deploy_dir libs
deploy_dir docs
deploy_dir reports
push_changes
echo "Deploy is finished successfully"
}

main
Loading