Skip to content

Commit

Permalink
Updates composite build approach for utils
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzkocer committed Sep 25, 2020
1 parent 6889bb5 commit f19af8b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
13 changes: 3 additions & 10 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,9 @@ dependencies {

implementation ('com.github.indexos.media-for-mobile:android:43a9026f0973a2f0a74fa813132f6a16f7499c3a')


if (buildUtilsFromLocalDirectory) {
implementation 'org.wordpress:WordPressUtils'
testImplementation 'org.wordpress:WordPressUtils'
debugImplementation 'org.wordpress:WordPressUtils'
} else {
implementation "org.wordpress:utils:$wordPressUtilsVersion"
testImplementation "org.wordpress:utils:$wordPressUtilsVersion"
debugImplementation "org.wordpress:utils:$wordPressUtilsVersion"
}
implementation "$gradle.ext.wputilsBinaryPath:$wordPressUtilsVersion"
testImplementation "$gradle.ext.wputilsBinaryPath:$wordPressUtilsVersion"
debugImplementation "$gradle.ext.wputilsBinaryPath:$wordPressUtilsVersion"
implementation (project(path:':libs:networking:WordPressNetworking')) {
exclude group: "com.android.volley"
exclude group: 'org.wordpress', module: 'utils'
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
ext.androidx_work_version = "2.0.1"
ext.buildGutenbergMobileJSBundle = 1
ext.wordPressUtilsVersion = '1.30'
ext.buildUtilsFromLocalDirectory = false

repositories {
google()
Expand Down
14 changes: 0 additions & 14 deletions included-builds-example.txt

This file was deleted.

1 change: 1 addition & 0 deletions local-builds.gradle-example
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ binary build if you're not working on a specific library.
*/
ext {
localFluxCPath = "../WordPress-FluxC-Android"
localWPUtilsPath = "../WordPress-Utils-Android"
}
19 changes: 10 additions & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ include ':libs:login:WordPressLoginFlow'
include ':libs:WordPressProcessors'
include ':libs:WordPressAnnotations'

def includedBuilds = new File('./included-builds.txt')
if (includedBuilds.exists()) {
includedBuilds.eachLine { line ->
if (!line.isEmpty() && !line.startsWith("#")) {
includeBuild(line)
}
}
}

include ':WordPressMocks'
project(':WordPressMocks').projectDir = new File(rootProject.projectDir, properties.getOrDefault('wp.wordpress_mocks_path', 'libs/mocks') + '/WordPressMocks')

Expand Down Expand Up @@ -64,6 +55,7 @@ if (properties.getOrDefault('wp.BUILD_GUTENBERG_FROM_SOURCE', false).toBoolean()
}

gradle.ext.fluxCBinaryPath = "com.github.wordpress-mobile.WordPress-FluxC-Android"
gradle.ext.wputilsBinaryPath = "org.wordpress:utils"

def localBuilds = new File('local-builds.gradle')
if (localBuilds.exists()) {
Expand All @@ -88,5 +80,14 @@ if (localBuilds.exists()) {
}
}
}

if (ext.has("localWPUtilsPath")) {
includeBuild(ext.localWPUtilsPath) {
dependencySubstitution {
println "Substituting wputils with the local build"
substitute module("$gradle.ext.wputilsBinaryPath") with project(':WordPressUtils')
}
}
}
}

0 comments on commit f19af8b

Please sign in to comment.