Skip to content

Commit

Permalink
read version from git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Geosearchef committed Oct 12, 2018
1 parent a77f068 commit 033ca71
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jdk:
- oraclejdk8
install: true
script:
- gradle -b ice-adapter/build.gradle shadowJar -PtagVersion=`git describe --tags --abbrev=0`
- gradle -b ice-adapter/build.gradle shadowJar -Pversion=${TRAVIS_TAG}
- mv ./ice-adapter/build/libs/ice-adapter-*-all.jar ./faf-ice-adapter.jar
deploy:
provider: releases
Expand Down
12 changes: 1 addition & 11 deletions ice-adapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply plugin: 'javafx-gradle-plugin'
apply plugin: 'com.github.johnrengelman.plugin-shadow'

group 'Geosearchef'

version = 'SNAPSHOT'


sourceCompatibility = 1.8
Expand All @@ -44,14 +44,4 @@ jar {
manifest {
attributes 'Main-Class': 'com.faforever.iceadapter.IceAdapter'
}
}

task getTagVersion {
if (project.hasProperty("tagVersion")) {
project.setVersion(tagVersion)
}
}

shadowJar {
dependsOn getTagVersion
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class IceAdapter {

public static volatile boolean running = true;

public static String VERSION = "snapshot";
public static String VERSION = "SNAPSHOT";
public static String COMMAND_LINE_ARGUMENTS;

public static int id = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ public static CandidatesMessage packCandidates(int srcId, int destId, Agent agen
candidatePacket.setRelPort(localCandidate.getRelatedAddress().getPort());
}

localCandidatesMessage.getCandidates().add(candidatePacket);
//Candidate type LOCAL and STUN can never occur as they are deprecated and not
if (IceAdapter.DEBUG_ALLOW_HOST && localCandidate.getType().equals(CandidateType.HOST_CANDIDATE)) {
localCandidatesMessage.getCandidates().add(candidatePacket);
}
if (IceAdapter.DEBUG_ALLOW_REFLEXIVE &&
(localCandidate.getType().equals(CandidateType.SERVER_REFLEXIVE_CANDIDATE) || localCandidate.getType().equals(CandidateType.PEER_REFLEXIVE_CANDIDATE))) {
localCandidatesMessage.getCandidates().add(candidatePacket);
}
if (IceAdapter.DEBUG_ALLOW_RELAY && localCandidate.getType().equals(CandidateType.RELAYED_CANDIDATE)) {
localCandidatesMessage.getCandidates().add(candidatePacket);
}
}

return localCandidatesMessage;
Expand Down

0 comments on commit 033ca71

Please sign in to comment.