-
-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from Frederikam/dev
Release v2.2
- Loading branch information
Showing
17 changed files
with
445 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
language: java | ||
|
||
addons: | ||
sonarcloud: | ||
organization: "fredboat" | ||
|
||
env: | ||
global: | ||
- BUILD_NUMBER: "$TRAVIS_BUILD_NUMBER" | ||
|
||
cache: | ||
directories: | ||
- "$HOME/.m2" | ||
- "$HOME/.gradle" | ||
- ".gradle/wrapper" | ||
- ".gradle/caches" | ||
- "$HOME/.sonar/cache" | ||
|
||
stages: | ||
- sonar | ||
|
||
jobs: | ||
fast_finish: true | ||
include: | ||
- stage: sonar | ||
jdk: openjdk8 | ||
if: env(TRAVIS_SECURE_ENV_VARS) = true | ||
before_script: | ||
#for full sonar cloud blame information | ||
- "git fetch --unshallow" | ||
script: | ||
- "./gradlew sonarqube -PincludeAnalysis" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
LavalinkServer/src/main/java/lavalink/server/info/AppInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package lavalink.server.info; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
/** | ||
* Created by napster on 25.06.18. | ||
* <p> | ||
* Requires app.properties to be populated with values during the gradle build | ||
*/ | ||
@Component | ||
public class AppInfo { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(AppInfo.class); | ||
|
||
private final String version; | ||
private final String groupId; | ||
private final String artifactId; | ||
private final String buildNumber; | ||
private final long buildTime; | ||
|
||
public AppInfo() { | ||
InputStream resourceAsStream = this.getClass().getResourceAsStream("/app.properties"); | ||
Properties prop = new Properties(); | ||
try { | ||
prop.load(resourceAsStream); | ||
} catch (IOException e) { | ||
log.error("Failed to load app.properties", e); | ||
} | ||
this.version = prop.getProperty("version"); | ||
this.groupId = prop.getProperty("groupId"); | ||
this.artifactId = prop.getProperty("artifactId"); | ||
this.buildNumber = prop.getProperty("buildNumber"); | ||
this.buildTime = Long.parseLong(prop.getProperty("buildTime")); | ||
} | ||
|
||
public String getVersion() { | ||
return this.version; | ||
} | ||
|
||
public String getGroupId() { | ||
return this.groupId; | ||
} | ||
|
||
public String getArtifactId() { | ||
return this.artifactId; | ||
} | ||
|
||
public String getBuildNumber() { | ||
return this.buildNumber; | ||
} | ||
|
||
public long getBuildTime() { | ||
return this.buildTime; | ||
} | ||
|
||
public String getVersionBuild() { | ||
return this.version + "_" + this.buildNumber; | ||
} | ||
} |
Oops, something went wrong.