Skip to content

Cameron #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
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
75 changes: 74 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
language: java

script: ./gradlew build
# the following will skip the installation of dependencies.

install: true



# the following forces the use of JDK 8

# matrix:

# include:

# - jdk: oraclejdk8



script:

- gradle clean build

- gradle dist --rerun-tasks

# - gradle distSetup --rerun-tasks

# - gradle zipDist --rerun-tasks

# - gradle zipTest --rerun-tasks



before_deploy:

- git config --global user.email "[email protected]"

- git config --global user.name "Travis CI"

- export GIT_TAG=$TRAVIS_BRANCH.$TRAVIS_BUILD_NUMBER

- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"

- git push -q https://[email protected]/cs3398-vulcans-ponfarr/java-hello-world-with-gradle/tree/Cameron --tags

- ls -R



deploy:

skip_cleanup: true

provider: releases

api_key:

secure: $GITPERM



file:

- "README.md"

- "build.gradle"

- ".travis.yml"



on:

tags: false

all_branches: true

140 changes: 113 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,67 +1,153 @@
/*

* This build file was auto generated by running the Gradle 'init' task

* by 'jabed' at '11/14/15 7:37 PM' with Gradle 2.8

*

* This generated file contains a commented-out sample Java project to get you started.

* For more details take a look at the Java Quickstart chapter in the Gradle

* user guide available at https://docs.gradle.org/2.8/userguide/tutorial_java_projects.html

*/

/*
// Apply the java plugin to add support for Java
apply plugin: 'java'

// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}

// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.12'

// Declare the dependency for your favourite test framework you want to use in your tests.
// TestNG is also supported by the Gradle Test task. Just change the
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
// 'test.useTestNG()' to your build script.
testCompile 'junit:junit:4.12'
}
*/

apply plugin: 'java'
apply plugin: 'eclipse'

apply plugin: 'application'

mainClassName = 'hello.HelloWorld'

// tag::repositories[]

repositories {

mavenCentral()

}

// end::repositories[]

// tag::jar[]

jar {

baseName = 'jb-hello-world'

version = '0.1.0'

}

// end::jar[]

// tag::dependencies[]
sourceCompatibility = 1.7
targetCompatibility = 1.7

sourceCompatibility = 1.8

targetCompatibility = 1.8

dependencies {

compile "joda-time:joda-time:2.2"
testCompile "junit:junit:4.12"

testCompile "org.junit.jupiter:junit-jupiter-api:5.0.1"

// the following is a work around to fix the warning:

// warning: unknown enum constant Status.STABLE

testCompileOnly "org.apiguardian:apiguardian-api:1.0.0"

}

// end::dependencies[]

task dist {

description "Generate the dist(s) into the dist folder."

}

task distSetup {

description "Generate the dist folder."

delete "${projectDir}/dist"

copy {

from "${buildDir}/libs"

into "${projectDir}/dist/main"

}

copy {

from "${projectDir}/build/classes/test/Output"

into "${projectDir}/dist/test"

}

}

task zipDist(type: Zip, dependsOn: distSetup) {

from "${projectDir}/dist/main"

from "${projectDir}/Readme.md"

destinationDir = file("${projectDir}/dist")

version = "${version}"

appendix = "Main"

doLast {

println "Created ${zipDist.archiveName}"

}

}

task zipTest(type: Zip, dependsOn: distSetup) {

from "${projectDir}/dist/test"

from "${projectDir}/Readme.md"

destinationDir = file("${projectDir}/dist")

version = "${version}"

appendix = "Test Output"

doLast{

println "Created ${zipTest.archiveName}"

}

}

distSetup.dependsOn(build)

dist.dependsOn(zipDist)

dist.dependsOn(zipTest)

// tag::wrapper[]

task wrapper(type: Wrapper) {
gradleVersion = '3.5'

gradleVersion = '4.9'

}

// end::wrapper[]
Binary file added build/classes/java/main/hello/Greeter.class
Binary file not shown.
Binary file added build/classes/java/main/hello/HelloWorld.class
Binary file not shown.
Binary file added build/classes/java/test/hello/TestGreeter.class
Binary file not shown.
Binary file added build/distributions/HelloWorld.tar
Binary file not shown.
Binary file added build/distributions/HelloWorld.zip
Binary file not shown.
Binary file added build/libs/jb-hello-world-0.1.0.jar
Binary file not shown.
101 changes: 101 additions & 0 deletions build/reports/tests/test/classes/hello.TestGreeter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - Class hello.TestGreeter</title>
<link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<script src="../js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>Class hello.TestGreeter</h1>
<div class="breadcrumbs">
<a href="../index.html">all</a> &gt;
<a href="../packages/hello.html">hello</a> &gt; TestGreeter</div>
<div id="summary">
<table>
<tr>
<td>
<div class="summaryGroup">
<table>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">2</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">0</div>
<p>failures</p>
</div>
</td>
<td>
<div class="infoBox" id="ignored">
<div class="counter">0</div>
<p>ignored</p>
</div>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.001s</div>
<p>duration</p>
</div>
</td>
</tr>
</table>
</div>
</td>
<td>
<div class="infoBox success" id="successRate">
<div class="percent">100%</div>
<p>successful</p>
</div>
</td>
</tr>
</table>
</div>
<div id="tabs">
<ul class="tabLinks">
<li>
<a href="#tab0">Tests</a>
</li>
</ul>
<div id="tab0" class="tab">
<h2>Tests</h2>
<table>
<thead>
<tr>
<th>Test</th>
<th>Duration</th>
<th>Result</th>
</tr>
</thead>
<tr>
<td class="success">testGreeter</td>
<td class="success">0.001s</td>
<td class="success">passed</td>
</tr>
<tr>
<td class="success">testGreeterEmpty</td>
<td class="success">0s</td>
<td class="success">passed</td>
</tr>
</table>
</div>
</div>
<div id="footer">
<p>
<div>
<label class="hidden" id="label-for-line-wrapping-toggle" for="line-wrapping-toggle">Wrap lines
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 5.3.1</a> at Apr 18, 2019, 5:55:50 PM</p>
</div>
</div>
</body>
</html>
Loading