Skip to content

Commit

Permalink
Merge branch 'trunk' into add-react-native-prompt-android
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle.kts
#	package-lock.json
#	package.json
#	settings.gradle.kts
  • Loading branch information
fluiddot committed Mar 10, 2022
2 parents 16d1bb2 + 230e77e commit 583d1c0
Show file tree
Hide file tree
Showing 6 changed files with 6,334 additions and 20 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
32 changes: 23 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import org.json.JSONObject

plugins {
id("com.github.node-gradle.node") version "3.1.1"
id("com.android.library") apply false
}

node {
download.set(true)
version.set("16.14.0")
}

val reactNativeVersion = "0.66.4"
val defaultCompileSdkVersion = 30
val defaultMinSdkVersion = 21
val defaultTargetSdkVersion = 30
Expand All @@ -24,6 +17,8 @@ project.ext.set("targetSdkVersion", defaultTargetSdkVersion)
val packageJson = JSONObject(File("$rootDir/package.json").readText())
val packageDevDependencies = packageJson.optJSONObject("devDependencies")

val reactNativeVersion = packageDevDependencies.optString("react-native")

subprojects {
apply(plugin = "maven-publish")

Expand Down Expand Up @@ -69,13 +64,23 @@ subprojects {
configure<PublishingExtension> {
publications {
create<MavenPublication>("S3") {
var packageVersion = packageDevDependencies.optString(project.name)
var packageVersion = getPackageVersion(project.name)
if (project.name == "react-native-prompt-android") {
packageVersion = "1.0.0"
}
println("Publishing configuration:\n\tartifactId=\"${project.name}\"\n\tversion=\"$packageVersion\"")

from(components.get("release"))
if (project.name == "react-native-reanimated" ) {
val defaultArtifacts = configurations.getByName("default").artifacts
if(defaultArtifacts.isEmpty()) {
throw Exception("'$name' - No default artifact found, aborting publishing!")
}
val defaultArtifact = defaultArtifacts.getFiles().getSingleFile()
artifact(defaultArtifact)
}
else {
from(components.get("release"))
}
groupId = "org.wordpress-mobile"
artifactId = project.name
version = packageVersion
Expand All @@ -91,3 +96,12 @@ subprojects {
}
}
}

fun getPackageVersion(projectName: String): String {
val jsonProperty = when {
projectName == "react-native-masked-view" -> "@react-native-masked-view/masked-view"
projectName == "react-native-clipboard" -> "@react-native-clipboard/clipboard"
else -> projectName
}
return packageDevDependencies.optString(jsonProperty)
}
Loading

0 comments on commit 583d1c0

Please sign in to comment.