1
0
mirror of synced 2026-01-05 21:02:13 -05:00
Files
airbyte/airbyte-webapp/build.gradle
Tim Roes 2c71086ab8 🪟 🔧 Add additional eslint rules (#17348)
* Add additional eslint rules

* Add comment

* Restore async await act

* Fix broken gradle reference
2022-10-03 17:43:14 +02:00

127 lines
3.0 KiB
Groovy

plugins {
id "base"
id "com.github.node-gradle.node" version "3.3.0"
}
def nodeVersion = System.getenv('NODE_VERSION') ?: '16.15.1'
// This array should contain a path to all configs that are common to most build tasks and
// might affect them (i.e. if any of those files change we want to rerun most tasks)
def commonConfigs = [
'.env',
'package.json',
'package-lock.json',
'tsconfig.json',
'.prettierrc.js'
]
node {
download = true
version = nodeVersion
}
npm_run_build {
inputs.files commonConfigs
inputs.file '.eslintrc.js'
inputs.dir 'public'
inputs.dir 'src'
outputs.dir 'build/app'
}
task test(type: NpmTask) {
dependsOn assemble
args = ['run', 'test', '--', '--watchAll=false', '--silent']
inputs.files commonConfigs
inputs.dir 'src'
}
task licenseCheck(type: NpmTask) {
dependsOn npmInstall
args = ['run', 'license-check']
inputs.files commonConfigs
inputs.file 'scripts/license-check.js'
// The licenseCheck has no outputs, thus we always treat the outpus up to date
// as long as the inputs have not changed
outputs.upToDateWhen { true }
}
task validateLinks(type: NpmTask) {
dependsOn npmInstall
args = ['run', 'validate-links']
// Since the output of this task depends on availability of URLs
// we never want to treat it as "up-to-date" and always want to run it
outputs.upToDateWhen { false }
}
task buildStorybook(type: NpmTask) {
dependsOn npmInstall
args = ['run', 'build:storybook']
inputs.files commonConfigs
inputs.dir '.storybook'
inputs.dir 'public'
inputs.dir 'src'
outputs.dir 'build/storybook'
}
task copyBuildOutput(type: Copy) {
dependsOn copyDocker, npm_run_build
from "${project.projectDir}/build/app"
into 'build/docker/bin/build'
}
task copyDocs(type: Copy) {
dependsOn copyDocker, copyBuildOutput
from "${project.rootProject.projectDir}/docs/integrations"
into "build/docker/bin/build/docs/integrations"
// google-ads.md is blocked by Ad Blockers
rename ('google-ads.md', 'gglad.md')
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
// Copy images that are used in .md integration documentation docs
task copyDocAssets(type: Copy) {
dependsOn copyDocker, copyBuildOutput
from "${project.rootProject.projectDir}/docs/.gitbook"
into "build/docker/bin/build/docs/.gitbook"
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
task copyNginx(type: Copy) {
dependsOn copyDocker
from "${project.projectDir}/nginx"
into "build/docker/bin/nginx"
}
task stylelint(type: NpmTask) {
dependsOn npmInstall
args = ['run', 'stylelint']
inputs.files commonConfigs
inputs.file '.stylelintrc'
inputs.dir 'src'
}
// Those tasks should be run as part of the "check" task
check.dependsOn validateLinks, licenseCheck, test, stylelint
build.dependsOn buildStorybook
tasks.named("buildDockerImage") {
dependsOn copyDocker
dependsOn copyBuildOutput
dependsOn copyNginx
dependsOn copyDocs
dependsOn copyDocAssets
}