Skip to content

Commit ea9848c

Browse files
committed
Adds Travis CI chain
1 parent a4a13a2 commit ea9848c

3 files changed

Lines changed: 51 additions & 2 deletions

File tree

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
language: java
2+
install: true # tells Travis that we run gradlew manually
23
jdk:
34
- openjdk8
45
- openjdk11
6+
before_cache:
7+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
8+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
9+
cache:
10+
directories:
11+
- $HOME/.gradle/caches/
12+
- $HOME/.gradle/wrapper/
13+
14+
stages:
15+
- name: build
16+
- name: snapshot
17+
if: branch = master
18+
- name: release
19+
if: branch = release
20+
21+
jobs:
22+
include:
23+
- stage: build
24+
script: ./gradlew build
25+
- stage: snapshot
26+
script: ./gradlew publish -x test -Dsnapshot=true -Dnexus.user=$NEXUS_USER -Dnexus.key=$NEXUS_KEY -Dbuild.number=$TRAVIS_BUILD_NUMBER
27+
- stage: release
28+
script: ./gradlew publish -x test -Dnexus.user=$NEXUS_USER -Dnexus.key=$NEXUS_KEY -Dbuild.number=$TRAVIS_BUILD_NUMBER
29+
530
deploy:
631
provider: releases
732
api_key:

build.gradle

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ plugins {
22
// Apply the java-library plugin to add support for Java Library
33
id 'java-library'
44
id 'maven'
5+
id 'maven-publish'
56
}
67

78
group = 'de.upb.crypto'
8-
version = '1.0.0-SNAPSHOT'
9+
version = '1.0.0' + (Boolean.valueOf(System.getProperty("snapshot")) ? "-SNAPSHOT" : "")
910

1011
description = """"""
1112

@@ -82,3 +83,25 @@ artifacts {
8283
archives packageTests
8384
}
8485

86+
publishing {
87+
publications {
88+
mavenJava(MavenPublication) {
89+
from components.java
90+
artifact packageTests
91+
}
92+
93+
}
94+
95+
repositories {
96+
maven {
97+
credentials {
98+
username = System.getProperty('nexus.user')
99+
password = System.getProperty('nexus.key')
100+
}
101+
def releasesRepoUrl = "https://nexus.cs.upb.de/repository/sfb901-snapshots/"
102+
def snapshotsRepoUrl = "https://nexus.cs.upb.de/repository/sfb901-snapshots/"
103+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
104+
}
105+
}
106+
}
107+
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Mon Oct 29 13:19:40 CET 2018
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

0 commit comments

Comments
 (0)