Skip to content

Commit 16f6514

Browse files
committed
Merge branch 'main' of https://github.com/open-telemetry/opentelemetry-proto-java into update-codeowners
2 parents 59f52a4 + 6b29d78 commit 16f6514

File tree

8 files changed

+85
-30
lines changed

8 files changed

+85
-30
lines changed

build.gradle.kts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import com.google.protobuf.gradle.*
22
import de.undercouch.gradle.tasks.download.Download
3-
import nebula.plugin.release.git.opinion.Strategies
3+
import nebula.plugin.release.git.base.TagStrategy
4+
import nebula.plugin.release.git.semver.NearestVersionLocator
45
import java.time.Duration
56

67
plugins {
@@ -14,7 +15,6 @@ plugins {
1415
}
1516

1617
release {
17-
defaultVersionStrategy = Strategies.getSNAPSHOT()
1818
}
1919

2020
tasks {
@@ -25,8 +25,15 @@ tasks {
2525

2626
description = "Java Bindings for the OpenTelemetry Protocol (OTLP)"
2727

28-
val grpcVersion = "1.44.0"
29-
val protobufVersion = "3.19.4"
28+
// Project version is set from -Prelease.version or inferred from the latest tag
29+
if (properties.contains("release.version")) {
30+
version = properties.get("release.version") as String
31+
} else {
32+
version = NearestVersionLocator(TagStrategy()).locate(release.grgit).any.toString()
33+
}
34+
35+
val grpcVersion = "1.56.1"
36+
val protobufVersion = "3.23.4"
3037

3138
repositories {
3239
mavenCentral()
@@ -64,7 +71,7 @@ protobuf {
6471
}
6572
}
6673

67-
val protoVersion = version.toString().removeSuffix("-SNAPSHOT").removeSuffix("-alpha")
74+
val protoVersion = version
6875
val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")
6976

7077
tasks {

buildSrc/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ repositories {
99
}
1010

1111
dependencies {
12-
implementation("com.diffplug.spotless:spotless-plugin-gradle:5.16.0")
13-
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.17")
12+
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.20.0")
1413
}

buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,54 @@ spotless {
2222
}
2323
plugins.withId("org.jetbrains.kotlin.jvm") {
2424
kotlin {
25-
ktlint().userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports"))
25+
ktlint().editorConfigOverride(mapOf(
26+
"indent_size" to "2",
27+
"continuation_indent_size" to "2",
28+
"max_line_length" to "160",
29+
"insert_final_newline" to "true",
30+
"ktlint_standard_no-wildcard-imports" to "disabled",
31+
// ktlint does not break up long lines, it just fails on them
32+
"ktlint_standard_max-line-length" to "disabled",
33+
// ktlint makes it *very* hard to locate where this actually happened
34+
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
35+
// depends on ktlint_standard_wrapping
36+
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled",
37+
// also very hard to find out where this happens
38+
"ktlint_standard_wrapping" to "disabled"
39+
))
2640
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|class|// Includes work from:)")
2741
}
2842
}
2943
kotlinGradle {
30-
ktlint().userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports"))
44+
ktlint().editorConfigOverride(mapOf(
45+
"indent_size" to "2",
46+
"continuation_indent_size" to "2",
47+
"max_line_length" to "160",
48+
"insert_final_newline" to "true",
49+
"ktlint_standard_no-wildcard-imports" to "disabled",
50+
// ktlint does not break up long lines, it just fails on them
51+
"ktlint_standard_max-line-length" to "disabled",
52+
// ktlint makes it *very* hard to locate where this actually happened
53+
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
54+
// depends on ktlint_standard_wrapping
55+
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled",
56+
// also very hard to find out where this happens
57+
"ktlint_standard_wrapping" to "disabled"
58+
))
3159
}
3260
format("misc") {
3361
// not using "**/..." to help keep spotless fast
3462
target(
63+
".gitignore",
3564
".gitattributes",
3665
".gitconfig",
3766
".editorconfig",
3867
"*.md",
3968
"src/**/*.md",
4069
"docs/**/*.md",
4170
"*.sh",
42-
"src/**/*.properties")
71+
"src/**/*.properties",
72+
)
4373
indentWithSpaces()
4474
trimTrailingWhitespace()
4575
endWithNewline()

gradle/wrapper/gradle-wrapper.jar

3.75 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionSha256Sum=03ec176d388f2aa99defcadc3ac6adf8dd2bce5145a129659537c0874dea5ad1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
5+
networkTimeout=10000
6+
validateDistributionUrl=true
47
zipStoreBase=GRADLE_USER_HOME
58
zipStorePath=wrapper/dists
6-
distributionSha256Sum=f581709a9c35e9cb92e16f585d2c4bc99b2b1a5f85d2badbd3dc6bff59e1e6dd

gradlew

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
9087

9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
@@ -133,22 +130,29 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
193197
done
194198
fi
195199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
196204
# Collect all arguments for the java command;
197205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198206
# shell script including quotes and variable substitutions, so put them in
@@ -205,6 +213,12 @@ set -- \
205213
org.gradle.wrapper.GradleWrapperMain \
206214
"$@"
207215

216+
# Stop when "xargs" is not available.
217+
if ! command -v xargs >/dev/null 2>&1
218+
then
219+
die "xargs is not available"
220+
fi
221+
208222
# Use "xargs" to parse quoted args.
209223
#
210224
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal

settings.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
pluginManagement {
22
plugins {
3-
id("com.google.protobuf") version "0.8.17"
4-
id("de.undercouch.download") version "4.1.2"
5-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
6-
id("nebula.release") version "16.0.0"
3+
id("com.google.protobuf") version "0.9.4"
4+
id("de.undercouch.download") version "5.4.0"
5+
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
6+
id("nebula.release") version "17.2.2"
77
}
88
}
99

0 commit comments

Comments
 (0)