Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8613591
Composite and binary build support for react-native android libraries
oguzkocer Feb 25, 2021
b9e90cc
Improve dependencies for react-native bridge and aztec projects
oguzkocer Mar 1, 2021
7bbfe56
Remove white color resource from bridge
oguzkocer Mar 1, 2021
904a56c
Remove waitForJitpack from react-native-bridge android build file
oguzkocer Mar 4, 2021
4c67a6c
Adds delay between publishing aztec and bridge android binaries
oguzkocer Mar 5, 2021
f1df772
Fix whitespace issues in publish-aztec-and-bridge.sh
oguzkocer Mar 5, 2021
39b06ca
Improve detection for where the publish script is run from
oguzkocer Mar 8, 2021
291441e
Improve error message for publish-aztec-and-bridge.sh
oguzkocer Mar 8, 2021
e58d4d2
Improve the error message for publish script for where it's run from
oguzkocer Mar 9, 2021
d9a4a70
Removes buildGutenbergFromSource parameter from WPAndroidGlueCode
oguzkocer Mar 9, 2021
ff509eb
Add an explanation to react-native-bridge/settings.gradle
oguzkocer Mar 9, 2021
1b97926
react-native-bridge now uses a remote repo for hermes dependency
oguzkocer Mar 10, 2021
38d8430
Cleanup react-native-bridge/settings.gradle
oguzkocer Mar 10, 2021
170b257
Use hermes dependency to mirror and improve pom generation code
oguzkocer Mar 11, 2021
3f5b35d
Merge pull request #3 from oguzkocer/react-native-composite-and-binar…
oguzkocer Mar 12, 2021
17422d3
Merge remote-tracking branch 'upstream/trunk' into react-native-compo…
oguzkocer Mar 25, 2021
2c4f8ef
Add s3 as remote repository to react-native-editor
oguzkocer Mar 26, 2021
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
104 changes: 77 additions & 27 deletions packages/react-native-aztec/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
gradlePluginVersion = '3.4.2'
gradlePluginVersion = '4.0.1'
kotlinVersion = '1.3.61'
supportLibVersion = '28.0.0'
supportLibVersion = '29.0.2'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
Expand All @@ -12,6 +12,7 @@ buildscript {
wordpressUtilsVersion = '1.22'
espressoVersion = '3.0.1'
aztecVersion = 'v1.3.45'
willPublishReactNativeAztecBinary = properties["publishReactNativeAztecVersion"]?.trim() as boolean
Comment thread
oguzkocer marked this conversation as resolved.
Resolved
}

repositories {
Expand All @@ -26,14 +27,19 @@ buildscript {
}
}

plugins {
id "com.jfrog.bintray"
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish' // this enables publishing via Bintray

group = 'com.github.wordpress-mobile.gutenberg-mobile'
// import the `readReactNativeVersion()` function
apply from: 'https://gist.githubusercontent.com/hypest/742448b9588b3a0aa580a5e80ae95bdf/raw/8eb62d40ee7a5104d2fcaeff21ce6f29bd93b054/readReactNativeVersion.gradle'

// fallback flag value for when lib is compiled individually (e.g. via jitpack)
project.ext.buildGutenbergFromSource = false
group = 'com.github.wordpress-mobile.gutenberg-mobile'

// The sample build uses multiple directories to
// keep boilerplate and common code separate from
Expand Down Expand Up @@ -81,11 +87,10 @@ repositories {

maven { url "https://jitpack.io" }

if (!rootProject.ext.buildGutenbergFromSource) {
// if not building from source (where the node_modules dir is used), use a remote RN maven repo
def reactNativeRepo = 'https://dl.bintray.com/wordpress-mobile/react-native-mirror/'
println "Will use the RN maven repo at ${reactNativeRepo}"
maven { url reactNativeRepo }
if (willPublishReactNativeAztecBinary) {
maven { url "https://dl.bintray.com/wordpress-mobile/react-native-mirror/" }
} else {
maven { url("$rootDir/../../../node_modules/react-native/android") }
Comment thread
oguzkocer marked this conversation as resolved.
Resolved
}
}

Expand All @@ -94,31 +99,76 @@ dependencies {
api "com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-shortcodes:$aztecVersion"
api "com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-comments:$aztecVersion"
api "com.github.wordpress-mobile.WordPress-Aztec-Android:glide-loader:$aztecVersion"
api "org.wordpress:utils:$wordpressUtilsVersion"
implementation "org.wordpress:utils:$wordpressUtilsVersion"

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

implementation 'androidx.appcompat:appcompat:1.0.0'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
testImplementation 'junit:junit:4.12'

def reactNativeVersion = reactNativeVersion()
logger.quiet("Using react-native version: $reactNativeVersion")
implementation "com.facebook.react:react-native:$reactNativeVersion"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
testImplementation 'junit:junit:4.13'

if (willPublishReactNativeAztecBinary) {
def rnVersion = readReactNativeVersion('../../../package.json', 'devDependencies')
println "react-native version for react-native-aztec: $rnVersion"
implementation "com.facebook.react:react-native:$rnVersion"
} else {
implementation "com.facebook.react:react-native:+"
}
}

// Returns react-native version based on environment
def reactNativeVersion() {
if (rootProject.ext.buildGutenbergFromSource) {
return '+'
if (willPublishReactNativeAztecBinary) {
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayKey') ? project.property('bintrayKey') : System.getenv('BINTRAY_KEY')
publications = ['ReactNativeAztecPublication']
publish = true
pkg {
repo = 'maven'
name = 'react-native-aztec'
licenses = ['GPL-2.0']
userOrg = 'wordpress-mobile'
vcsUrl = 'https://github.com/wordpress-mobile/gutenberg-mobile.git'
version {
name = publishReactNativeAztecVersion
released = new Date()
}
}
}

project.afterEvaluate {
publishing {
publications {
ReactNativeAztecPublication(MavenPublication) {
artifact bundleReleaseAar

groupId 'com.github.wordpress-mobile.gutenberg-mobile'
artifactId 'react-native-aztec'
version publishReactNativeAztecVersion

addDependenciesToPom(pom)
}
}
}
}
}

def packageFile = new File("$projectDir/../../../package.json")
def packageContent = new groovy.json.JsonSlurper().parseText(packageFile.text)
return packageContent['devDependencies']['react-native']
// Publication doesn't know about dependencies, so we need to manually add them
def addDependenciesToPom(pom) {
pom.withXml {
def dependenciesNode = asNode().getAt('dependencies')[0] ?: asNode().appendNode('dependencies')

// Iterate over the implementation dependencies, adding a <dependency> node for each
configurations.implementation.allDependencies
.findAll { it instanceof ExternalDependency && it.name != 'unspecified' }
.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}

2 changes: 2 additions & 0 deletions packages/react-native-aztec/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
shouldPublishBinary=false

Binary file not shown.
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-5.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion packages/react-native-aztec/android/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion packages/react-native-aztec/android/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion packages/react-native-aztec/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
rootProject.name = '@wordpress/react-native-aztec'
pluginManagement {
plugins {
id 'com.jfrog.bintray' version '1.8.5'
Comment thread
oguzkocer marked this conversation as resolved.
Resolved
}
}

rootProject.name = '@wordpress_react-native-aztec'

Loading