cleanup personal references
This commit is contained in:
@@ -2,9 +2,6 @@ package com.birbit.android.bindingdemo.vo;
|
||||
|
||||
import com.birbit.android.bindingdemo.R;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/19/14.
|
||||
*/
|
||||
public class Users {
|
||||
public static final User[] robots = new User[]{
|
||||
new User("romain", "guy", R.drawable.romain, User.ROBOT),
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
apply plugin: 'java'
|
||||
|
||||
sourceCompatibility = 1.7
|
||||
|
||||
version = '1.0'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||
}
|
||||
@@ -30,22 +30,23 @@ import java.util.List;
|
||||
public class LayoutParser {
|
||||
public static void main(String[] args) throws MalformedURLException {
|
||||
KLayoutParser parser = new KLayoutParser("com.android.bindingapp",
|
||||
Arrays.asList(new File("/Users/yboyar/Documents/git/BindingApp/app/src/main/res")),
|
||||
new File("/Users/yboyar/Documents/git/BindingApp/app/build/generated/source/r/debug"),
|
||||
new File("/Users/yboyar/Documents/git/BindingApp/app/build/intermediates/res/debug"));
|
||||
Arrays.asList(new File("BindingDemo/app/src/main/res")),
|
||||
new File("BindingDemo/app/build/generated/source/r/debug"),
|
||||
new File("BindingDemo/app/build/intermediates/res/debug"));
|
||||
parser.process();
|
||||
parser.writeAttrFile();
|
||||
parser.writeBrFile();
|
||||
|
||||
// TODO get from local.properties
|
||||
URL jarUrl = new File("/Users/yboyar/android/sdk/platforms/android-21/android.jar").toURI().toURL();
|
||||
URLClassLoader androidClassLoader = new URLClassLoader(new URL[]{jarUrl});
|
||||
List<File> cpFiles = new ArrayList<>();
|
||||
cpFiles.add(new File("/Users/yboyar/Documents/git/BindingApp/app/build/intermediates/classes/debug"));
|
||||
cpFiles.add(new File("/Users/yboyar/Documents/git/BindingApp/app/build/intermediates/dependency-cache/debug"));
|
||||
cpFiles.add(new File("BindingApp/app/build/intermediates/classes/debug"));
|
||||
cpFiles.add(new File("BindingApp/app/build/intermediates/dependency-cache/debug"));
|
||||
cpFiles.add(new File(
|
||||
"/Users/yboyar/Documents/git/BindingApp/app/build/intermediates/exploded-aar/com.android.databinding/library/0.1-SNAPSHOT/classes.jar"));
|
||||
"BindingApp/app/build/intermediates/exploded-aar/com.android.databinding/library/0.1-SNAPSHOT/classes.jar"));
|
||||
cpFiles.add(new File(
|
||||
"/Users/yboyar/Documents/git/BindingApp/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0/classes.jar"
|
||||
"BindingApp/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0/classes.jar"
|
||||
));
|
||||
URL[] urls = new URL[cpFiles.size()];
|
||||
for (int i = 0; i < cpFiles.size(); i++) {
|
||||
|
||||
@@ -21,9 +21,6 @@ import com.android.databinding.ext.toCamelCaseAsVar
|
||||
import com.android.databinding.ext.times
|
||||
import com.android.databinding.ext.getIndentation
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/11/14.
|
||||
*/
|
||||
public fun List<String>.joinToCamelCase(): String = when(size()) {
|
||||
0 -> throw IllegalArgumentException("invalid section size, cannot be zero")
|
||||
1 -> this.get(0).toCamelCase()
|
||||
|
||||
@@ -18,10 +18,6 @@ package com.android.databinding.ext
|
||||
|
||||
import org.w3c.dom.Node
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/11/14.
|
||||
*/
|
||||
|
||||
public fun Node.getAndroidId() : String? =
|
||||
getAttributes()?.getNamedItem("android:id")?.getNodeValue()
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@ import com.android.databinding.ext.joinToCamelCaseAsVar
|
||||
import com.android.databinding.ext.joinIndented
|
||||
import com.android.databinding.ext.joinIndentedExceptFirst
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/11/14.
|
||||
*/
|
||||
public fun String.extractAndroidId() : String = this.split("/")[1]
|
||||
|
||||
public fun String.times(x : Int) : String = 0.rangeTo(x-1).map { this }.join("")
|
||||
|
||||
@@ -32,9 +32,6 @@ import com.android.databinding.parser.VariableRef
|
||||
import com.android.databinding.parser.SymbolExpr
|
||||
import com.android.databinding.util.Log
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/16/14.
|
||||
*/
|
||||
class ExpressionParser {
|
||||
val model = ExprModel()
|
||||
val visitor = ExprVisitor(model)
|
||||
|
||||
@@ -21,10 +21,6 @@ import java.util.HashSet
|
||||
import com.android.databinding.vo.Variable
|
||||
import com.android.databinding.util.Log
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/16/14.
|
||||
*/
|
||||
|
||||
public open class ExprModel {
|
||||
var start : Expr by Delegates.notNull()
|
||||
val variables = hashMapOf<String, VariableRef>()
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/10/14.
|
||||
*/
|
||||
package com.android.databinding.renderer
|
||||
|
||||
import java.util.TreeSet
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/9/14.
|
||||
*/
|
||||
package com.android.databinding.renderer
|
||||
|
||||
import java.util.TreeMap
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/8/14.
|
||||
*/
|
||||
package com.android.databinding.renderer
|
||||
|
||||
class DataBinderRenderer(val pkg: String, val projectPackage: String, val className: String, val renderers : List<ViewExprBinderRenderer> ) {
|
||||
|
||||
@@ -27,9 +27,6 @@ import com.android.databinding.ext.toCamelCaseAsVar
|
||||
import com.android.databinding.ext.joinIndentedExceptFirst
|
||||
import com.android.databinding.ext.joinIndented
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/17/14.
|
||||
*/
|
||||
class ViewExprBinderRenderer(val pkg: String, val projectPackage: String, val baseClassName: String,
|
||||
val layoutName:String, val lb: LayoutExprBinding) {
|
||||
val className = "${baseClassName}Impl"
|
||||
|
||||
@@ -22,9 +22,6 @@ import com.android.databinding.ext.toCamelCase
|
||||
import com.android.databinding.util.Log
|
||||
import java.lang.reflect.Modifier
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/12/14.
|
||||
*/
|
||||
public fun Class<*>.isObservable() : Boolean = ClassAnalyzer.instance.observable.isAssignableFrom(this)
|
||||
|
||||
public fun Class<*>.getCodeName() : String = getName().replace("$", ".")
|
||||
|
||||
@@ -32,10 +32,6 @@ import com.android.databinding.util.Log
|
||||
import com.android.databinding.ext.joinToCamelCaseAsVar
|
||||
import com.android.databinding.util.isObservable
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/17/14.
|
||||
*/
|
||||
|
||||
class Binding(val target : BindingTarget, val targetFieldName : String, val expr : Expr) {
|
||||
// which variables effect the result of this binding
|
||||
// ordered by depth
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
org.gradle.daemon=true
|
||||
#org.gradle.fork=true
|
||||
org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx1024m -Dfile.encoding=UTF-8
|
||||
@@ -129,11 +129,6 @@ class DataBinderPlugin : Plugin<Project> {
|
||||
//TODO
|
||||
val codeGenTargetFolder = variantData.generateRClassTask.getSourceOutputDir()
|
||||
val resGenTargetFolder = variantData.generateRClassTask.getResDir()
|
||||
// variantData.getExtraGeneratedSourceFolders().forEach {
|
||||
// log("extra source gen folder ${it}")
|
||||
// }
|
||||
// val codeGenTargetFolder = File(sources[2].toString())//File("/Users/yboyar/Desktop/tmp/binding")//variantData.processResourcesTask.getSourceOutputDir()
|
||||
// val resGenTargetFolder = File(sources[2].toString())//File("/Users/yboyar/Desktop/tmp/binding")//variantData.processResourcesTask.getResDir()
|
||||
variantData.addJavaSourceFoldersToModel(codeGenTargetFolder)
|
||||
val jCompileTask = variantData.javaCompileTask
|
||||
val dexTask = variantData.dexTask
|
||||
@@ -171,8 +166,6 @@ class DataBinderPlugin : Plugin<Project> {
|
||||
val dexTask = variantData.dexTask
|
||||
log("dex task files: ${dexTask.getInputFiles()} ${dexTask.getInputFiles().javaClass}")
|
||||
log("compile CP: ${jCompileTask.getClasspath().getAsPath()}")
|
||||
//TODO get from target sdk
|
||||
//val jarUrl = File("/Users/yboyar/android/sdk/platforms/android-21/android.jar").toURI().toURL()
|
||||
val jarUrl = androidJar.toURI().toURL()
|
||||
val androidClassLoader = URLClassLoader(array(jarUrl))
|
||||
val cpFiles = arrayListOf<File>()
|
||||
|
||||
164
tools/data-binding/gradlew
vendored
164
tools/data-binding/gradlew
vendored
@@ -1,164 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
@@ -20,9 +20,6 @@ import org.antlr.v4.runtime.ANTLRInputStream;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeWalker;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/15/14.
|
||||
*/
|
||||
public class Main {
|
||||
static String input = "`name` + last_name";
|
||||
static class Field {
|
||||
|
||||
@@ -18,9 +18,6 @@ package com.android.databinding.library;
|
||||
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/9/14.
|
||||
*/
|
||||
public class BaseObservable implements Observable {
|
||||
final ObservableHelper mHelper;
|
||||
|
||||
|
||||
@@ -26,9 +26,6 @@ import android.view.ViewGroup;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/8/14.
|
||||
*/
|
||||
public class DataBinder {
|
||||
|
||||
static DataBinderMapper sMapper;
|
||||
|
||||
@@ -18,9 +18,6 @@ package com.android.databinding.library;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/8/14.
|
||||
*/
|
||||
public interface DataBinderMapper {
|
||||
ViewDataBinder getDataBinder(View view, int layoutId);
|
||||
public int getId(String key);
|
||||
|
||||
@@ -18,9 +18,6 @@ package com.android.databinding.library;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/14/14.
|
||||
*/
|
||||
public interface IViewDataBinder {
|
||||
public View getRoot();
|
||||
public abstract void rebindDirty();
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package com.android.databinding.library;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/9/14.
|
||||
*/
|
||||
public interface Observable {
|
||||
public void register(ObservableListener listener);
|
||||
public void unRegister(ObservableListener listener);
|
||||
|
||||
@@ -18,9 +18,6 @@ package com.android.databinding.library;
|
||||
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/19/14.
|
||||
*/
|
||||
public class ObservableHelper implements Observable {
|
||||
final Observable owner;
|
||||
CopyOnWriteArraySet<ObservableListener> mListeners;
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package com.android.databinding.library;
|
||||
|
||||
/**
|
||||
* Created by yboyar on 11/9/14.
|
||||
*/
|
||||
public interface ObservableListener {
|
||||
public void onChange();
|
||||
public void onChange(int fieldId);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
rootProject.name = 'KDataBinder'
|
||||
|
||||
include ':grammerBuilder'
|
||||
|
||||
include 'library'
|
||||
|
||||
include 'compiler'
|
||||
include 'gradlePlugin'
|
||||
|
||||
Reference in New Issue
Block a user