Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.callstack.react.brownfield.processors.VariantTaskProvider
import com.callstack.react.brownfield.shared.BaseProject
import com.callstack.react.brownfield.shared.GradleProps
import com.callstack.react.brownfield.utils.Extension
import com.callstack.react.brownfield.utils.Utils
import org.gradle.api.ProjectConfigurationException
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ResolvedArtifact
Expand Down Expand Up @@ -55,7 +56,7 @@ class ArtifactsResolver(
* expo project does not exist in example-android-library so doing an
* early exit.
*/
if (baseProject.project.name == "example-android-library") {
if (Utils.isExampleLibrary(baseProject.project.name)) {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,19 @@ class RNBrownfieldPlugin

override fun apply(project: Project) {
verifyAndroidPluginApplied(project)

initializers(project)

/**
* Make sure that expo project is evaluated before the android library.
* This ensures that the expo modules are available to link with the
* android library, when it is evaluated.
*/
val expoProjectPath = ":expo"
val hasExpoProject = project.findProject(expoProjectPath) != null
if (hasExpoProject) {
project.evaluationDependsOn(expoProjectPath)
}

RNSourceSets.configure(project, extension)
projectConfigurations.setup()
registerRClassTransformer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.callstack.react.brownfield.plugin
import com.android.build.gradle.LibraryExtension
import com.callstack.react.brownfield.exceptions.NameSpaceNotFound
import com.callstack.react.brownfield.utils.Extension
import com.callstack.react.brownfield.utils.Utils
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.Directory
Expand All @@ -27,7 +28,7 @@ object RNSourceSets {
* be present on the consuming library, which is not the case
* with our example library.
*/
if (project.name == "example-android-library") {
if (Utils.isExampleLibrary(project.name)) {
return
}
this.project = project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ object Utils {
output.appendText("\n${file.readText(Charsets.UTF_8)}\n")
}
}

fun isExampleLibrary(projectName: String): Boolean {
return projectName == "example-android-library"
}
}
Loading