Skip to content

Commit 7c3c4ab

Browse files
committed
+ update 0.8.1
1 parent 3d81728 commit 7c3c4ab

7 files changed

Lines changed: 91 additions & 6 deletions

File tree

freeline_core/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44

55
VERSION_FORMATTER = '{}({})'
6-
FREELINE_VERSION = 'v0.8.0'
6+
FREELINE_VERSION = 'v0.8.1'
77

88

99
def get_freeline_version():

gradle/bintray.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def developerEmail = 'yong.hy@alipay.com'
1515
def publishedGroupId = 'com.antfortune.freeline'
1616
def artifact = 'gradle'
1717
def libraryName = 'freeline-gradle'
18-
def publishVersion = '0.8.0'
18+
def publishVersion = '0.8.1'
1919

2020
install {
2121
repositories {

gradle/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'java'
33
apply from: 'bintray.gradle'
44

55
group 'com.antfortune.freeline'
6-
version '0.8.0'
6+
version '0.8.1'
77

88
sourceCompatibility = 1.6
99
targetCompatibility = 1.6
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package com.antfortune.freeline
2+
3+
import groovy.json.JsonBuilder
4+
import org.gradle.api.Project;
5+
6+
/**
7+
* Created by huangyong on 16/11/3.
8+
*/
9+
class FreelineAnnotationCollector {
10+
11+
public static final def ANNOTATION_CLASSES = [
12+
"Landroid/databinding/BindingAdapter;",
13+
"Landroid/databinding/BindingConversion;",
14+
"Landroid/databinding/Bindable;",
15+
]
16+
17+
public static final def ANNOTATION_TARGETS = [
18+
"Landroid/databinding/BindingAdapter;": "BindingAdapter",
19+
"Landroid/databinding/BindingConversion;": "BindingConversion",
20+
"Landroid/databinding/Bindable;": "Bindable"
21+
]
22+
23+
private static def sAnnotationCollection = [:]
24+
25+
public static void addNewAnno(String anno, String path, String className, String entry, boolean isJar) {
26+
String key = ANNOTATION_TARGETS[anno]
27+
if (!sAnnotationCollection.containsKey(key)) {
28+
sAnnotationCollection[key] = []
29+
}
30+
31+
sAnnotationCollection[key].add(['path': path, 'className': className, 'entry': entry, 'isJar': isJar])
32+
}
33+
34+
public static void saveCollections(Project project, String buildCacheDirPath, Map modules) {
35+
def description = FreelineUtils.readProjectDescription(project)
36+
sAnnotationCollection.keySet().each { key ->
37+
sAnnotationCollection[key].each { value ->
38+
if (value['isJar']) {
39+
modules.each { m, sep ->
40+
if (value['path'].contains(sep)) {
41+
value['module'] = m
42+
value['java_path'] = findJavaPath(description, m as String, value['className'] as String)
43+
return false
44+
}
45+
}
46+
} else {
47+
value['module'] = project.name
48+
value['java_path'] = findJavaPath(description, project.name, value['className'] as String)
49+
}
50+
}
51+
}
52+
53+
def json = new JsonBuilder(sAnnotationCollection).toPrettyString()
54+
println json
55+
FreelineUtils.saveJson(json, FreelineUtils.joinPath(buildCacheDirPath, "freeline_annotation_info.json"), true)
56+
57+
sAnnotationCollection.clear()
58+
}
59+
60+
private static String findJavaPath(def description, String module, String className) {
61+
if (description != null) {
62+
if (description['project_source_sets'].containsKey(module)) {
63+
def relatedPath = className.replace("/", File.separator).replace(".class", ".java")
64+
if (!relatedPath.endsWith(".java")) {
65+
relatedPath = relatedPath + ".java"
66+
}
67+
68+
def javaPath = null
69+
description['project_source_sets'][module]['main_src_directory'].each { path ->
70+
File file = new File(FreelineUtils.joinPath(path as String, relatedPath))
71+
if (file.exists()) {
72+
javaPath = file.absolutePath
73+
return false
74+
}
75+
}
76+
77+
if (javaPath != null) {
78+
return javaPath
79+
}
80+
}
81+
}
82+
return null
83+
}
84+
85+
}

gradle/src/main/groovy/com/antfortune/freeline/FreelinePlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import org.gradle.util.VersionNumber
1515
*/
1616
class FreelinePlugin implements Plugin<Project> {
1717

18-
String freelineVersion = "0.8.0"
18+
String freelineVersion = "0.8.1"
1919

2020
@Override
2121
void apply(Project project) {

sample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88
dependencies {
99
classpath 'com.android.tools.build:gradle:2.2.2'
10-
classpath 'com.antfortune.freeline:gradle:0.8.0'
10+
classpath 'com.antfortune.freeline:gradle:0.8.1'
1111
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
1212
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
1313
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

sample/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19-
FREELINE_RELEASE_VERSION=0.8.0
19+
FREELINE_RELEASE_VERSION=0.8.1

0 commit comments

Comments
 (0)