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:
parent
09d371ba09
commit
c3261b427e
|
|
@ -22,7 +22,6 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- id: setup-java-8
|
||||
name: Setup Java 8
|
||||
uses: actions/setup-java@v1
|
||||
|
|
@ -51,7 +50,6 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- id: setup-java-11
|
||||
name: Setup Java 11
|
||||
uses: actions/setup-java@v1
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ needs.prepare-release-branch.outputs.release-branch-name }}
|
||||
submodules: true
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
|
|
@ -84,8 +83,6 @@ jobs:
|
|||
- run: git push
|
||||
- name: Checkout master
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: burrunan/gradle-cache-action@v1.5
|
||||
with:
|
||||
job-id: jdk11
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- id: setup-java-8
|
||||
name: Setup Java 8
|
||||
uses: actions/setup-java@v1
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@ jobs:
|
|||
coverage: true
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- id: setup-java-8
|
||||
name: Setup Java 8
|
||||
uses: actions/setup-java@v1
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
[submodule "proto/src/main/proto"]
|
||||
path = proto/src/main/proto
|
||||
url = https://github.com/open-telemetry/opentelemetry-proto.git
|
||||
|
|
@ -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,
|
||||
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`
|
||||
|
||||
or alternatively initialize submodules for an existing clone.
|
||||
|
||||
`git submodule init`
|
||||
`git submodule update`
|
||||
`git clone https://github.com/open-telemetry/opentelemetry-java.git`
|
||||
|
||||
3. Run the following commands to build, run tests and most static analysis, and
|
||||
check formatting:
|
||||
|
|
@ -116,3 +111,14 @@ It does not support all required rules, so you still have to run `spotlessApply`
|
|||
### Unit 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
|
||||
|
|
@ -3,6 +3,7 @@ plugins {
|
|||
id "maven-publish"
|
||||
|
||||
id "com.google.protobuf"
|
||||
id "de.undercouch.download"
|
||||
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
|
||||
// generated Java directories as source folders.
|
||||
idea {
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 59c488bfb8fb6d0458ad6425758b70259ff4a2bd
|
||||
|
|
@ -6,6 +6,7 @@ pluginManagement {
|
|||
id "com.google.protobuf" version "0.8.14"
|
||||
id "com.jfrog.artifactory" version "4.18.0"
|
||||
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 "me.champeau.gradle.jmh" version "0.5.2"
|
||||
id "nebula.release" version "15.3.0"
|
||||
|
|
|
|||
Loading…
Reference in New Issue