Skip to content

Commit

Permalink
fix(publish): use path isAbsolute()
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 committed Jan 9, 2023
1 parent 14b8250 commit ac48530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
11 changes: 7 additions & 4 deletions framework/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.nio.file.Paths

/*
*
* Tencent is pleased to support the open source community by making
Expand Down Expand Up @@ -142,15 +144,16 @@ dependencies {
embed project(path: ':devtools-integration', configuration: 'default')
embed project(path: ':connector-support', configuration: 'default')
embed project(path: ':connector-dom', configuration: 'default')
def modules = MODULES.substring(1, MODULES.length() - 1).split(',')
def modules = MODULES.split(',')
for (String module : modules) {
if (module.matches("^[a-zA-Z]:/.*") || module.matches("^/.*")) {
ArrayList<String> paths = module.split('/')
String path = module.trim()
if (Paths.get(path).isAbsolute()) {
ArrayList<String> paths = path.split('/')
paths.remove(0)
def subProjectName = paths.join('-')
embed project(path: ":$subProjectName", configuration: 'default')
} else {
def subProjectName = 'connector-' + module.replace("/", "-")
def subProjectName = 'connector-' + path.replace("/", "-")
embed project(path: ":$subProjectName", configuration: 'default')
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ MIN_VERSION=21
TARGET_VERSION=30

#
#Indicate the connector that need to be included in the build product
# Indicate the connector that need to be included in the build product
#
MODULES="driver/js,renderer/native"
MODULES=driver/js,renderer/native
10 changes: 6 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import java.nio.file.Paths

include 'connector-support'
project(':connector-support').projectDir = new File('framework/android/connector/support')
Expand Down Expand Up @@ -26,17 +27,18 @@ project(':devtools-integration').projectDir = new File('devtools/devtools-integr
include 'example'
project(':example').projectDir = new File('framework/examples/android-demo')

def modules = MODULES.substring(1, MODULES.length() - 1).split(',')
def modules = MODULES.split(',')
for (String module : modules) {
if (module.matches("^[a-zA-Z]:/.*") || module.matches("^/.*")) {
String path = module.trim()
if (Paths.get(path).isAbsolute()) {
ArrayList<String> paths = module.split('/')
paths.remove(0)
def subProjectName = paths.join('-')
include "$subProjectName"
project(":$subProjectName").projectDir = new File(module)
project(":$subProjectName").projectDir = new File(path)
} else {
def subProjectName = 'connector-' + module.replace("/", "-")
def projectPath = 'framework/android/connector/' + module
def projectPath = 'framework/android/connector/' + path
include "$subProjectName"
project(":$subProjectName").projectDir = new File(projectPath)
}
Expand Down

0 comments on commit ac48530

Please sign in to comment.