Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Android/DevSample/buildSrc/src/main/groovy/net/wequick/gradle/AppPlugin.groovy
  • Loading branch information
xufan committed Mar 28, 2017
2 parents 0a5eb75 + 64b8067 commit 0dd3cf6
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 33 deletions.
11 changes: 11 additions & 0 deletions Android/DevSample/buildSrc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.2.0-beta3 (2017-03-27)

Bugfixes:

- 修正 Android Plugin 2.3.0 下未能正确保留插件模块 JNI 的问题 (@xufan)
- 修正span类型字符串(`<b>Hello</b>`)无法被正确编译的问题 (#335, @jasonrongdevelop)

Other:

- 使用8个空格替代`\t`来打印编译log,以保证整齐

## 1.2.0-beta2 (2017-03-21)

Bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion Android/DevSample/buildSrc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gradle-small-plugin是一个gradle插件,用来打包安卓组件包。
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta2'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta3'
}
}
Expand Down
2 changes: 1 addition & 1 deletion Android/DevSample/buildSrc/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
org.gradle.daemon=true

group=net.wequick.tools.build
version=1.2.0-beta2
version=1.2.0-beta3
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,18 @@ class AppPlugin extends BundlePlugin {

def jniDirs = android.sourceSets.main.jniLibs.srcDirs
if (jniDirs == null) jniDirs = []

// Collect ABIs from AARs
mTransitiveDependentLibProjects.each {
com.android.build.gradle.BaseExtension libAndrioid = it.android
jniDirs += libAndrioid.sourceSets.main.jniLibs.srcDirs
def mergeJniLibsTask = project.tasks.withType(TransformTask.class).find {
it.variantName == 'release' && it.transform.name == 'mergeJniLibs'
}
if (mergeJniLibsTask != null) {
jniDirs.addAll(mergeJniLibsTask.streamInputs.findAll {
it.isDirectory() && !shouldStripInput(it)
})
}

// Filter ABIs
def filters = android.defaultConfig.ndkConfig.abiFilters
jniDirs.each { dir ->
dir.listFiles().each { File d ->
Expand All @@ -970,6 +977,16 @@ class AppPlugin extends BundlePlugin {
return JNIUtils.getABIFlag(abis)
}

protected boolean shouldStripInput(File input) {
AarPath aarPath = new AarPath(input)
for (aar in small.splitAars) {
if (aarPath.explodedFromAar(aar)) {
return true
}
}
return false
}

protected void hookVariantTask(BaseVariant variant) {
hookMergeAssets(variant.mergeAssets)

Expand Down Expand Up @@ -997,15 +1014,9 @@ class AppPlugin extends BundlePlugin {
def hookMergeJniLibs(TransformTask t) {
stripAarFiles(t, { splitPaths ->
t.streamInputs.each {
AarPath aarPath = new AarPath(it)
for (aar in mUserLibAars) {
if (aarPath.explodedFromAar(aar)) {
// keep the user libraries
return
}
if (shouldStripInput(it)) {
splitPaths.add(it)
}

splitPaths.add(it)
}
})
}
Expand All @@ -1020,13 +1031,9 @@ class AppPlugin extends BundlePlugin {
if (it.configName == 'main' || it.configName == 'release') return

it.sourceFiles.each {
def version = it.parentFile
def name = version.parentFile
def group = name.parentFile
def aar = [group: group.name, name: name.name, version: version.name]
if (mUserLibAars.contains(aar)) return

paths.add(it)
if (shouldStripInput(it)) {
paths.add(it)
}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public class AssetEditor extends CppHexEditor {
def l = s.length
offset += l + lenData.length + 1 // 1 for 0x0

ids.add(it.name)
it.name = stringCount
stringCount++
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ public final class Log {
}

public static void success(String text) {
print String.format('\t%-64s', text)
print String.format(' %-64s', text)
println AnsiUtils.green('[ OK ]')
}

public static void warn(String text) {
println AnsiUtils.red(String.format('\t%s', text))
println AnsiUtils.red(String.format(' %s', text))
}

public static void footer(String text) {
println AnsiUtils.white(String.format('\t%s', text))
println AnsiUtils.white(String.format(' %s', text))
}
}
4 changes: 4 additions & 0 deletions Android/DevSample/small/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.0-beta3 (2017-03-27)

版本同步

## 1.2.0-beta2 (2017-03-21)

版本同步
Expand Down
2 changes: 1 addition & 1 deletion Android/DevSample/small/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=net.wequick.small
version=1.2.0-beta2
version=1.2.0-beta3
4 changes: 2 additions & 2 deletions Android/GETTING-STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta2'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta3'
}
}
Expand All @@ -47,7 +47,7 @@ apply plugin: 'net.wequick.small'

```groovy
small {
aarVersion = '1.2.0-beta2'
aarVersion = '1.2.0-beta3'
}
```

Expand Down
4 changes: 2 additions & 2 deletions Android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
```groovy
buildscript {
dependencies {
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta2'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta3'
}
}
apply plugin: 'net.wequick.small'
small {
aarVersion = '1.2.0-beta2'
aarVersion = '1.2.0-beta3'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
<TextView android:id="@+id/section_label" android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<TextView android:id="@+id/span_label" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/span"
android:layout_below="@id/section_label" />

<net.wequick.example.small.lib.utils.MyTextView
android:id="@+id/my_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/section_label"
android:layout_below="@id/span_label"
app:label="Hello!" />

<TextView android:id="@+id/assets_label" android:layout_width="wrap_content"
Expand Down
3 changes: 3 additions & 0 deletions Android/Sample/app.mine/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<string name="pick">Pick</string>
<string name="call_system">Call system intent</string>
<string name="play_video">Play video in raw</string>
<string name="test_span1"><u>test</u></string>
<string name="span">Hello <b>span</b> string! <i>Fix</i> <b><i>#335</i></b>!</string>
<string name="test_span2"><h1>test2</h1></string>
</resources>
4 changes: 2 additions & 2 deletions Android/Sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta2'
classpath 'net.wequick.tools.build:gradle-small:1.2.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -27,7 +27,7 @@ apply plugin: 'net.wequick.small'

small {
buildToAssets = false
aarVersion = '1.2.0-beta2'
aarVersion = '1.2.0-beta3'
android {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
Expand Down
4 changes: 2 additions & 2 deletions Android/templates/activities/SmallLauncher/globals.xml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<global id="assetsOut" value="./app/src/main/assets" />
<global id="mavenUrl" value="mavenCentral" />
<global id="copyGradleSupported" type="boolean" value="${(compareVersions(gradlePluginVersion, '2.0') < 0)?string}" />
<global id="smallPluginVersion" value="1.2.0-beta2" />
<global id="smallAarVersion" value="1.2.0-beta2" />
<global id="smallPluginVersion" value="1.2.0-beta3" />
<global id="smallAarVersion" value="1.2.0-beta3" />
</globals>

0 comments on commit 0dd3cf6

Please sign in to comment.