This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Generate protos #4
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b44362e
Update .gitignore
jlegoff 3b960cb
Add opamp-spec as a submodule
jlegoff d85aac7
Add build script for protos
jlegoff 134e532
Generate protos
jlegoff e07dce3
Do not commit protos to the repository
jlegoff 5a6784b
Pin opamp spec to v0.6.0
jlegoff e2d8637
Remove note about generating protos
jlegoff 71288d3
Remove unused directory
jlegoff 46f153b
Remove unused settings.gradle.kts
jlegoff 912c769
Bump protobuf version
jlegoff 680aaa8
Remove duplicate gradle repository definition
jlegoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,8 @@ | ||
* text=auto eol=lf | ||
|
||
*.bat text eol=crlf | ||
*.cmd text eol=crlf | ||
|
||
*.jar -text | ||
*.png -text | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "opamp-spec"] | ||
path = opamp-spec | ||
url = [email protected]:open-telemetry/opamp-spec.git | ||
branch = v0.6.0 | ||
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,8 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} |
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,13 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
implementation("com.diffplug.spotless:spotless-plugin-gradle:5.16.0") | ||
} |
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,88 @@ | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | ||
|
||
plugins { | ||
`java-library` | ||
|
||
eclipse | ||
idea | ||
|
||
id("otel.spotless-conventions") | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
|
||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
tasks { | ||
withType<JavaCompile>().configureEach { | ||
with(options) { | ||
release.set(8) | ||
|
||
//disable deprecation warnings for the protobuf module | ||
compilerArgs.add("-Xlint:-deprecation") | ||
|
||
encoding = "UTF-8" | ||
} | ||
} | ||
|
||
withType<Test>().configureEach { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
exceptionFormat = TestExceptionFormat.FULL | ||
showExceptions = true | ||
showCauses = true | ||
showStackTraces = true | ||
} | ||
maxHeapSize = "1500m" | ||
} | ||
|
||
withType<Javadoc>().configureEach { | ||
exclude("io/opentelemetry/**/internal/**") | ||
|
||
with(options as StandardJavadocDocletOptions) { | ||
source = "8" | ||
encoding = "UTF-8" | ||
docEncoding = "UTF-8" | ||
breakIterator(true) | ||
|
||
addBooleanOption("html5", true) | ||
|
||
links("https://docs.oracle.com/javase/8/docs/api/") | ||
addBooleanOption("Xdoclint:all,-missing", true) | ||
} | ||
} | ||
|
||
withType<Jar>().configureEach { | ||
manifest { | ||
attributes( | ||
"Automatic-Module-Name" to "io.opentelemetry.proto", | ||
"Built-By" to System.getProperty("user.name"), | ||
"Built-JDK" to System.getProperty("java.version"), | ||
"Implementation-Title" to project.name, | ||
"Implementation-Version" to project.version) | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
withType<Javadoc>().configureEach { | ||
with(options as StandardJavadocDocletOptions) { | ||
val title = "${project.description}" | ||
docTitle = title | ||
windowTitle = title | ||
} | ||
} | ||
} | ||
} | ||
|
||
configurations.configureEach { | ||
resolutionStrategy { | ||
failOnVersionConflict() | ||
preferProjectModules() | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts
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,47 @@ | ||
plugins { | ||
id("com.diffplug.spotless") | ||
} | ||
|
||
spotless { | ||
java { | ||
googleJavaFormat() | ||
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|public|// Includes work from:)") | ||
target("src/**/*.java") | ||
} | ||
plugins.withId("groovy") { | ||
groovy { | ||
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|class)") | ||
} | ||
} | ||
plugins.withId("scala") { | ||
scala { | ||
scalafmt() | ||
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|public)") | ||
target("src/**/*.scala") | ||
} | ||
} | ||
plugins.withId("org.jetbrains.kotlin.jvm") { | ||
kotlin { | ||
ktlint().userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports")) | ||
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|class|// Includes work from:)") | ||
} | ||
} | ||
kotlinGradle { | ||
ktlint().userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports")) | ||
} | ||
format("misc") { | ||
// not using "**/..." to help keep spotless fast | ||
target( | ||
".gitattributes", | ||
".gitconfig", | ||
".editorconfig", | ||
"*.md", | ||
"src/**/*.md", | ||
"docs/**/*.md", | ||
"*.sh", | ||
"src/**/*.properties") | ||
indentWithSpaces() | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
} | ||
} |
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,5 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
Binary file not shown.
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with
.gitmodules
files, but the info in here points to the wrong repository. We don't have these files inopentelemetry-java
oropentelemetry-java-instrumentation
. Care to summarize their purpose?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the opamp-spec repo is used to get the proto definitions, as suggested in the issue. Here I set up a submodule and pinned it to the latest release.