diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml index 18b867356c0..e0dd7a06268 100644 --- a/.github/workflows/master-build.yml +++ b/.github/workflows/master-build.yml @@ -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 diff --git a/.github/workflows/patch-release-build.yml b/.github/workflows/patch-release-build.yml index ea5ea1b4d54..98ac761f0e4 100644 --- a/.github/workflows/patch-release-build.yml +++ b/.github/workflows/patch-release-build.yml @@ -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 diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 0e34952889f..177e4dcf508 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -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 diff --git a/.github/workflows/pr-examples-build.yml b/.github/workflows/pr-examples-build.yml index 1712be68cc3..eff7744f31a 100644 --- a/.github/workflows/pr-examples-build.yml +++ b/.github/workflows/pr-examples-build.yml @@ -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 diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 362fb7e9dc3..bc2060a5ecd 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -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 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bf5cae3ad33..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "proto/src/main/proto"] - path = proto/src/main/proto - url = https://github.com/open-telemetry/opentelemetry-proto.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c5be0e0034..16411eb8061 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 \ No newline at end of file diff --git a/proto/build.gradle b/proto/build.gradle index 279de9534d1..d842390b8c1 100644 --- a/proto/build.gradle +++ b/proto/build.gradle @@ -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 { diff --git a/proto/src/main/proto b/proto/src/main/proto deleted file mode 160000 index 59c488bfb8f..00000000000 --- a/proto/src/main/proto +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 59c488bfb8fb6d0458ad6425758b70259ff4a2bd diff --git a/settings.gradle b/settings.gradle index d0f6212d81c..496238b5abd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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"