Replace git submodules for protos with download of archive file. (#2160)

* Replace git submodules for protos with download of archive file.

* Add docs for proto and remove junk
This commit is contained in:
Anuraag Agrawal 2020-12-01 13:23:03 +09:00 committed by GitHub
parent 09d371ba09
commit c3261b427e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 53 additions and 21 deletions

View File

@ -22,7 +22,6 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: true
- id: setup-java-8 - id: setup-java-8
name: Setup Java 8 name: Setup Java 8
uses: actions/setup-java@v1 uses: actions/setup-java@v1
@ -51,7 +50,6 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: true
- id: setup-java-11 - id: setup-java-11
name: Setup Java 11 name: Setup Java 11
uses: actions/setup-java@v1 uses: actions/setup-java@v1

View File

@ -49,7 +49,6 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
ref: ${{ needs.prepare-release-branch.outputs.release-branch-name }} ref: ${{ needs.prepare-release-branch.outputs.release-branch-name }}
submodules: true
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 11 java-version: 11
@ -84,8 +83,6 @@ jobs:
- run: git push - run: git push
- name: Checkout master - name: Checkout master
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
submodules: true
- uses: burrunan/gradle-cache-action@v1.5 - uses: burrunan/gradle-cache-action@v1.5
with: with:
job-id: jdk11 job-id: jdk11

View File

@ -22,7 +22,6 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: true
- id: setup-java-8 - id: setup-java-8
name: Setup Java 8 name: Setup Java 8
uses: actions/setup-java@v1 uses: actions/setup-java@v1

View File

@ -21,8 +21,6 @@ jobs:
coverage: true coverage: true
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
submodules: true
- id: setup-java-8 - id: setup-java-8
name: Setup Java 8 name: Setup Java 8
uses: actions/setup-java@v1 uses: actions/setup-java@v1

View File

@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-java@v1 - uses: actions/setup-java@v1
with: with:
java-version: 11 java-version: 11

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "proto/src/main/proto"]
path = proto/src/main/proto
url = https://github.com/open-telemetry/opentelemetry-proto.git

View File

@ -28,14 +28,9 @@ types of static analysis.
The tests that require docker are disabled if docker is not present. If you wish to run them, The tests that require docker are disabled if docker is not present. If you wish to run them,
you must run a local docker daemon. you must run a local docker daemon.
2. Clone the repository recursively 2. Clone the repository
`git clone https://github.com/open-telemetry/opentelemetry-java.git --recursive` `git clone https://github.com/open-telemetry/opentelemetry-java.git`
or alternatively initialize submodules for an existing clone.
`git submodule init`
`git submodule update`
3. Run the following commands to build, run tests and most static analysis, and 3. Run the following commands to build, run tests and most static analysis, and
check formatting: check formatting:
@ -116,3 +111,14 @@ It does not support all required rules, so you still have to run `spotlessApply`
### Unit Tests ### Unit Tests
* Unit tests target Java 8, so language features such as lambda and streams can be used in tests. * Unit tests target Java 8, so language features such as lambda and streams can be used in tests.
## Common tasks
### Updating OTLP proto dependency version
The OTLP proto dependency version is defined [here](proto/build.gradle). To bump the version,
1. Find the latest release version [here](https://github.com/open-telemetry/opentelemetry-proto/releases/latest)
2. Download the zip source code archive
3. Run `shasum -a 256 ~/path/to/downloaded.zip` to compute its checksum
4. Update `protoVersion` and `protoChecksum` in the build file with the new version and checksum

View File

@ -3,6 +3,7 @@ plugins {
id "maven-publish" id "maven-publish"
id "com.google.protobuf" id "com.google.protobuf"
id "de.undercouch.download"
id "ru.vyarus.animalsniffer" id "ru.vyarus.animalsniffer"
} }
@ -43,6 +44,44 @@ protobuf {
} }
} }
def protoVersion = "0.6.0"
// To generate checksum, download the file and run "shasum -a 256 ~/path/to/vfoo.zip"
def protoChecksum = "a40003d50a565c989283d6b5b93b6189c28378387b715bdd54bf4600bb9c17c1"
def protoArchivePath = "$buildDir/archives/opentelemetry-proto-${protoVersion}.zip"
def downloadProtoArchive = tasks.register("downloadProtoArchive", Download) {
onlyIf { !file(protoArchivePath).exists() }
src "https://github.com/open-telemetry/opentelemetry-proto/archive/v${protoVersion}.zip"
dest protoArchivePath
}
def verifyProtoArchive = tasks.register("verifyProtoArchive", Verify) {
dependsOn(downloadProtoArchive)
src protoArchivePath
algorithm "SHA-256"
checksum protoChecksum
}
def unzipProtoArchive = tasks.register("unzipProtoArchive", Copy) {
dependsOn(verifyProtoArchive)
from zipTree(protoArchivePath)
into "$buildDir/protos"
}
sourceSets {
main {
proto {
srcDir "$buildDir/protos/opentelemetry-proto-${protoVersion}"
}
}
}
afterEvaluate {
tasks.named("generateProto") {
dependsOn(unzipProtoArchive)
}
}
// IntelliJ complains that the generated classes are not found, ask IntelliJ to include the // IntelliJ complains that the generated classes are not found, ask IntelliJ to include the
// generated Java directories as source folders. // generated Java directories as source folders.
idea { idea {

@ -1 +0,0 @@
Subproject commit 59c488bfb8fb6d0458ad6425758b70259ff4a2bd

View File

@ -6,6 +6,7 @@ pluginManagement {
id "com.google.protobuf" version "0.8.14" id "com.google.protobuf" version "0.8.14"
id "com.jfrog.artifactory" version "4.18.0" id "com.jfrog.artifactory" version "4.18.0"
id "com.jfrog.bintray" version "1.8.5" id "com.jfrog.bintray" version "1.8.5"
id "de.undercouch.download" version "4.1.1"
id "io.morethan.jmhreport" version "0.9.0" id "io.morethan.jmhreport" version "0.9.0"
id "me.champeau.gradle.jmh" version "0.5.2" id "me.champeau.gradle.jmh" version "0.5.2"
id "nebula.release" version "15.3.0" id "nebula.release" version "15.3.0"