Skip to content

Commit

Permalink
Merge pull request #80 from Tinder/fix_missing_transitive_deps_error
Browse files Browse the repository at this point in the history
[Bazel] Update for bazel 7.1.2
  • Loading branch information
tinder-aminghadersohi authored Jun 11, 2024
2 parents cfac8a3 + 8fa50d8 commit eb8a6be
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 1.8
java-version: 11
id: java
- uses: actions/checkout@v2
- name: Build Deploy Jar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/samples_gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
java-version: 11
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
Expand Down
9 changes: 9 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ kt_jvm_binary(
"cli/src/main/kotlin/com/tinder/gitquery/cli/GitQueryCli.kt",
],
)

load("@io_bazel_rules_kotlin//kotlin:core.bzl", "define_kt_toolchain")

define_kt_toolchain(
name = "kotlin_toolchain",
api_version = "1.8", # "1.1", "1.2", "1.3", "1.4", "1.5" "1.6", "1.7", "1.8", or "1.9"
jvm_target = "11", # "1.6", "1.8", "9", "10", "11", "12", "13", "15", "16", "17", "18", "19", "20" or "21"
language_version = "1.8", # "1.1", "1.2", "1.3", "1.4", "1.5" "1.6", "1.7", "1.8", or "1.9"
)
3 changes: 2 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
kotlin_repositories()

load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
kt_register_toolchains()
# kt_register_toolchains()
register_toolchains("//:kotlin_toolchain")

load("@rules_jvm_external//:defs.bzl", "maven_install")

Expand Down
11 changes: 6 additions & 5 deletions bazel_support/constants.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
Constants used in GitQuery configs
"""

RULES_JVM_EXTERNAL_TAG = "4.0"
RULES_JVM_EXTERNAL_SHA = "31701ad93dbfe544d597dbe62c9a1fdd76d81d8a9150c2bf1ecf928ecdf97169"
RULES_JVM_EXTERNAL_TAG = "6.1"
RULES_JVM_EXTERNAL_SHA = "42a6d48eb2c08089961c715a813304f30dc434df48e371ebdd868fc3636f0e82"

RULES_KOTLIN_VERSION = "v1.5.0-beta-4"
RULES_KOTLIN_SHA = "6cbd4e5768bdfae1598662e40272729ec9ece8b7bded8f0d2c81c8ff96dc139d"
RULES_KOTLIN_VERSION = "v1.9.5"
RULES_KOTLIN_SHA = "34e8c0351764b71d78f76c8746e98063979ce08dcf1a91666f3f3bc2949a533d"

MAVEN_ARTIFACTS = [
"org.yaml:snakeyaml:1.27",
"com.github.ajalt.clikt:clikt-jvm:3.1.0"
"com.github.ajalt.clikt:clikt-jvm:3.1.0",
"org.seleniumhq.selenium:selenium-java:4.16.1",
]
28 changes: 18 additions & 10 deletions bazel_support/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@ Methods to assist in loading dependencies for GitQuery in WORKSPACE files
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//bazel_support:constants.bzl",
"RULES_JVM_EXTERNAL_TAG",
load(
"//bazel_support:constants.bzl",
"RULES_JVM_EXTERNAL_SHA",
"RULES_JVM_EXTERNAL_TAG",
"RULES_KOTLIN_SHA",
"RULES_KOTLIN_VERSION",
"RULES_KOTLIN_SHA"
)

def _maybe(repo_rule, name, **kwargs):
if not native.existing_rule(name):
repo_rule(name = name, **kwargs)

def gitquery_dependencies(rules_jvm_external_tag=RULES_JVM_EXTERNAL_TAG,
rules_jvm_external_sha=RULES_JVM_EXTERNAL_SHA,
rules_kotlin_version=RULES_KOTLIN_VERSION,
rules_kotlin_sha=RULES_KOTLIN_SHA):

def gitquery_dependencies(
rules_jvm_external_tag = RULES_JVM_EXTERNAL_TAG,
rules_jvm_external_sha = RULES_JVM_EXTERNAL_SHA,
rules_kotlin_version = RULES_KOTLIN_VERSION,
rules_kotlin_sha = RULES_KOTLIN_SHA):
_maybe(
http_archive,
name = "io_bazel_rules_kotlin",
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % RULES_KOTLIN_VERSION],
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin-%s.tar.gz" % (RULES_KOTLIN_VERSION, RULES_KOTLIN_VERSION)],
sha256 = RULES_KOTLIN_SHA,
)

Expand All @@ -31,5 +32,12 @@ def gitquery_dependencies(rules_jvm_external_tag=RULES_JVM_EXTERNAL_TAG,
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % rules_jvm_external_tag,
sha256 = rules_jvm_external_sha,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % rules_jvm_external_tag
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % rules_jvm_external_tag,
)

_maybe(
http_archive,
name = "rules_java",
sha256 = "eb7db63ed826567b2ceb1ec53d6b729e01636f72c9f5dfb6d2dfe55ad69d1d2a",
url = "https://github.com/bazelbuild/rules_java/releases/download/7.2.0/rules_java-7.2.0.tar.gz",
)
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ allprojects {
mavenCentral()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "11"
}
tasks.withType<Detekt> {
// Target version of the generated JVM bytecode. It is used for type resolution.
this.jvmTarget = "1.8"
this.jvmTarget = "11"
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Libs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Libs {
const val googleJavaFormatCli = "1.7"
const val gradlePluginPublish = "0.17.0"
const val junit = "4.13.2"
const val kotlin = "1.5.31"
const val kotlin = "1.8.0"
const val ktlint = "0.43.0"
const val ktlintGradlePlugin = "10.2.0"
const val snakeyaml = "1.29"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ package com.tinder.gitquery.core
* This file was generated by ./build-support/bin/write-version-class
*/

const val GIT_QUERY_VERSION = "3.0.12"
const val GIT_QUERY_VERSION = "3.1.0"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.daemon=true
org.gradle.parallel=true

GROUP=com.tinder.gitquery
VERSION_NAME=3.0.12
VERSION_NAME=3.1.0

POM_DESCRIPTION=A library for querying and syncing files in a remote git repo.
POM_URL=https://github.com/Tinder/GitQuery
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit eb8a6be

Please sign in to comment.