Skip to content

Commit

Permalink
upgrade to Gradle 7.2 (airbytehq#7070)
Browse files Browse the repository at this point in the history
* upgrade to gradle 7.2

* get build working with gradle 7.2

* fix build

* fix connector build?

* EXCLUDE distTar and switch includes to excludes

* switch back to includes

* temporarily try to adjust properties

* don't know why this was modified

* revert spotless upgrade

* upgrade gradle node (better arm support it says)

* add back in Xss since we are getting StackOverflowError without it

* revert bad spotless fmt

* fix acceptance tests duplicates strategy

* add zip for jdbc includes

* check if this helps for java connectors

* remove accidental commit

* remove redundant

* fix warning explosion

* oops

* override gradle.properties

* remove set-env
  • Loading branch information
jrhizor authored Oct 15, 2021
1 parent c129e02 commit 1b59228
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 30 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ jobs:
- name: Install Pyenv
run: python3 -m pip install virtualenv==16.7.9 --user

- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
- name: Generate Template scaffold
run: ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates --scan

Expand Down Expand Up @@ -231,6 +240,15 @@ jobs:
- name: Install Pyenv
run: python3 -m pip install virtualenv==16.7.9 --user

- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
- name: Format
run: SUB_BUILD=PLATFORM ./gradlew format --scan --info --stacktrace

Expand Down Expand Up @@ -355,6 +373,15 @@ jobs:
- name: Install Cypress Test Dependencies
run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
- name: Build Platform Docker Images
run: SUB_BUILD=PLATFORM ./gradlew --no-daemon composebuild --scan

Expand Down Expand Up @@ -441,6 +468,15 @@ jobs:
run: |
mkdir -p /home/runner
- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
- name: Install socat (required for port forwarding)
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion airbyte-db/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
annotationProcessor('org.projectlombok:lombok:1.18.20')

// MongoDB
compile 'org.mongodb:mongodb-driver-sync:4.3.0'
implementation 'org.mongodb:mongodb-driver-sync:4.3.0'
}

task(newConfigsMigration, dependsOn: 'classes', type: JavaExec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation project(':airbyte-integrations:bases:base-java')

implementation 'org.apache.kafka:kafka-clients:2.8.0'
compile 'com.joestelmach:natty:0.11'
implementation 'com.joestelmach:natty:0.11'

integrationTestJavaImplementation project(':airbyte-integrations:bases:standard-destination-test')
integrationTestJavaImplementation project(':airbyte-integrations:connectors:destination-keen')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
implementation project(':airbyte-integrations:bases:base-java')
implementation project(':airbyte-protocol:models')

compile 'org.mongodb:mongodb-driver-sync:4.3.0'
implementation 'org.mongodb:mongodb-driver-sync:4.3.0'

testImplementation 'org.testcontainers:mongodb:1.15.3'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
implementation files(project(':airbyte-integrations:bases:base-java').airbyteDocker.outputs)
implementation project(':airbyte-integrations:connectors:source-relational-db')

compile 'org.mongodb:mongodb-driver-sync:4.3.0'
implementation 'org.mongodb:mongodb-driver-sync:4.3.0'

testImplementation 'org.testcontainers:mongodb:1.15.3'

Expand Down
2 changes: 1 addition & 1 deletion airbyte-scheduler/client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ dependencies {
// todo (cgardens) - remove this dep. just needs temporal client.
implementation project(':airbyte-workers')

compile 'com.google.cloud:google-cloud-storage:2.0.1'
implementation 'com.google.cloud:google-cloud-storage:2.0.1'

}
4 changes: 4 additions & 0 deletions airbyte-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ task automaticMigrationAcceptanceTest(type: Test) {
}
mustRunAfter test
}

tasks.withType(Copy) {
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
3 changes: 2 additions & 1 deletion airbyte-webapp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "base"
id "com.github.node-gradle.node" version "2.2.4"
id "com.github.node-gradle.node" version "3.1.1"
}

node {
Expand Down Expand Up @@ -33,6 +33,7 @@ build.finalizedBy test
task copyDocs(type: Copy) {
from "${System.getProperty("user.dir")}/docs/integrations/getting-started"
into "${buildDir}/docs/getting-started/"
duplicatesStrategy DuplicatesStrategy.INCLUDE
}

copyDocs.dependsOn npm_run_build
Expand Down
12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'base'
id 'pmd'
id 'com.diffplug.spotless' version '5.7.0'
id 'com.github.hierynomus.license' version '0.15.0'
id 'com.github.hierynomus.license' version '0.16.1'
}

repositories {
Expand Down Expand Up @@ -168,7 +168,7 @@ subprojects {
pmd {
consoleOutput = true

rulePriority = 5
rulesMinimumPriority = 5
ruleSets = []
ruleSetFiles = files(rootProject.file('tools/gradle/pmd/rules.xml'))
}
Expand Down Expand Up @@ -237,6 +237,14 @@ subprojects {
testImplementation 'org.mockito:mockito-junit-jupiter:3.9.0'
testImplementation 'org.assertj:assertj-core:3.21.0'
}

tasks.withType(Tar) {
duplicatesStrategy DuplicatesStrategy.INCLUDE
}

tasks.withType(Zip) {
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
}

task composeBuild {
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ repositories {
dependencies {
implementation 'ru.vyarus:gradle-use-python-plugin:2.3.0'
}

tasks.withType(Jar) {
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
10 changes: 8 additions & 2 deletions buildSrc/src/main/groovy/airbyte-docker.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.slf4j.Logger

Expand All @@ -15,16 +19,18 @@ import java.nio.file.Paths

@CacheableTask
abstract class AirbyteDockerTask extends DefaultTask {
@Input
@Internal
abstract File rootDir

@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
abstract FileCollection projectFiles

@Input
abstract Set<String> baseImageHashes

@Input
@InputDirectory
@PathSensitive(PathSensitivity.RELATIVE)
abstract File projectDir

@Input
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# NOTE: some of these values are overwritten in CI!
# NOTE: if you want to override this for your local machine, set overrides in ~/.gradle/gradle.properties

org.gradle.parallel=true
org.gradle.jvmargs=-Xmx4g -Xss4m
org.gradle.caching=true
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down

0 comments on commit 1b59228

Please sign in to comment.