Skip to content

Commit ce5b1ff

Browse files
authored
Merge pull request #43 from Tapadoo/unique-issues-but-boring-java
Unique issues but boring java
2 parents 419da7e + 0dc66de commit ce5b1ff

File tree

8 files changed

+61
-11
lines changed

8 files changed

+61
-11
lines changed

CHANGELOG.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2023.1
2+
* changing version scheme, attempting a quick fix for repeated issues
3+
4+
# 4.5.0
5+
* changing plugin name from slackNotifier to tpSlackNotifier incase it's causing conflicts with official one
6+
17
# 4.4.1
28
* Added support for teamcity configuration parameter "system.SLACK_IGNORE_COMMIT_MESSAGE" to allow user to ignore adding commits to slack message.
39

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apply plugin: 'java'
1111

1212

1313
sourceCompatibility = 1.8
14-
version = '4.4.1'
14+
version = '2023.1'
1515
println("##teamcity[buildNumber '$version']")
1616

1717
configurations {

gradle/wrapper/gradle-wrapper.jar

1.25 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Feb 24 18:44:46 GMT 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip

gradlew

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
109125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110126
fi
111127

112-
# For Cygwin, switch paths to Windows format before running java
113-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
114130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116132
JAVACMD=`cygpath --unix "$JAVACMD"`

gradlew.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

src/main/java/com/tapadoo/slacknotifier/SlackServerAdapter.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
import java.net.HttpURLConnection;
2121
import java.net.MalformedURLException;
2222
import java.net.URL;
23+
import java.util.ArrayList;
2324
import java.util.Collection;
2425
import java.util.Date;
2526
import java.util.List;
2627

2728

29+
2830
/**
2931
* Created by jasonconnery on 02/03/2014.
3032
*/
@@ -273,7 +275,18 @@ else if( projectSettings != null && projectSettings.getChannel() != null && proj
273275
{
274276

275277
//We do!
276-
Collection<Issue> issues = build.getRelatedIssues();
278+
ArrayList<Issue> issues = new ArrayList<Issue>();
279+
280+
// Filter the isseues by id - NOTE: I tried fancier language features , but I had issues with syntax, sdk, and compiling
281+
// so it was quicker to write a traditional, inefficient nested loop than it was to improve my java
282+
for (Issue issue : build.getRelatedIssues()) {
283+
for (Issue existingIssue : issues) {
284+
if (existingIssue.getId().equalsIgnoreCase(issue.getId())) {
285+
break;
286+
}
287+
}
288+
issues.add(issue);
289+
}
277290

278291
StringBuilder issueIds = new StringBuilder();
279292
StringBuilder clickableIssueIds = new StringBuilder();

teamcity-plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<teamcity-plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="urn:shemas-jetbrains-com:teamcity-plugin-v1-xml">
44
<info>
5-
<name>slackNotifier</name> <!-- the name of plugin used in teamcity -->
6-
<display-name>Slack Notifier</display-name>
7-
<version>4.4.1</version>
5+
<name>tpSlackNotifier</name> <!-- the name of plugin used in teamcity -->
6+
<display-name>Tapadoo Slack Notifier</display-name>
7+
<version>2023.1</version>
88
<description>Post build success notifications to Slack</description>
99
<vendor>
1010
<name>Tapadoo</name>

0 commit comments

Comments
 (0)