Skip to content

Commit

Permalink
Don't register checkIntegrityBetweenArchitectures task when install…
Browse files Browse the repository at this point in the history
…ed as a dependency (#2953)

## Description

Fixes
#2952

It seems like Gradle is doing some funny things and a task that isn't
executed anywhere is causing builds to fail. Instead of checking the
environment when the task is run, don't register it at all when
installed as a dependency.

Also updates a workflow file, so that both actions can pass at the same
time 😃.
  • Loading branch information
j-piasecki committed Jun 21, 2024
1 parent 4332c57 commit 6c44b7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-paper-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
if: github.repository == 'software-mansion/react-native-gesture-handler'
runs-on: ubuntu-latest
concurrency:
group: kotlin-lint-${{ github.ref }}
group: check-paper-integrity-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
Expand Down
30 changes: 14 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -289,26 +289,24 @@ if (isGHExampleApp() && isNewArchitectureEnabled() && !project.hasProperty('skip
tasks.generateCodegenArtifactsFromSchema.finalizedBy('copyCodegenArtifacts')
}

tasks.register('checkIntegrityBetweenArchitectures') {
group 'Verification tasks'
description 'Task to check integrity between fabric and paper architecture in terms of codegen generated interfaces/delegates'

if (isGHExampleApp()) {
return
}
if (project == rootProject) {
tasks.register('checkIntegrityBetweenArchitectures') {
group 'Verification tasks'
description 'Task to check integrity between fabric and paper architecture in terms of codegen generated interfaces/delegates'

def absoluteCodegenArtifactsPaperDestination = "../${project.property('codegenArtifactsPaperDestination')}"
def absoluteCodegenArtifactsSource = "../${project.property('codegenArtifactsSource')}"
def absoluteCodegenArtifactsPaperDestination = "../${project.property('codegenArtifactsPaperDestination')}"
def absoluteCodegenArtifactsSource = "../${project.property('codegenArtifactsSource')}"

def existingFiles = fileTree(absoluteCodegenArtifactsPaperDestination).matching {
include '**/*.java'
}
def existingFiles = fileTree(absoluteCodegenArtifactsPaperDestination).matching {
include '**/*.java'
}

existingFiles.forEach { existingFile ->
def generatedFile = new File("${absoluteCodegenArtifactsSource}/${existingFile.name}")
existingFiles.forEach { existingFile ->
def generatedFile = new File("${absoluteCodegenArtifactsSource}/${existingFile.name}")

if (existingFile.text != generatedFile.text) {
throw new RuntimeException("[react-native-gesture-handler] The source of ${existingFile.name} does not match with the one generated by codegen. Please check if you commited changes produced by copyCodegenArtifacts task.")
if (existingFile.text != generatedFile.text) {
throw new RuntimeException("[react-native-gesture-handler] The source of ${existingFile.name} does not match with the one generated by codegen. Please check if you commited changes produced by copyCodegenArtifacts task.")
}
}
}
}

0 comments on commit 6c44b7c

Please sign in to comment.