aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--.travis.yml28
-rw-r--r--all/build.gradle73
-rw-r--r--build.gradle131
-rw-r--r--checkstyle.xml219
-rw-r--r--core/build.gradle10
-rw-r--r--core_context_impl/build.gradle9
-rw-r--r--core_impl/build.gradle9
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin0 -> 54212 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xgradlew172
-rw-r--r--gradlew.bat84
-rw-r--r--settings.gradle14
-rw-r--r--shared/build.gradle1
14 files changed, 762 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 710949e1..d6946b2b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,9 @@
+# Gradle
+build
+gradle.properties
+.gradle
+local.properties
+
# Bazel
bazel-*
diff --git a/.travis.yml b/.travis.yml
index ea64ce3e..b8788bd2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,12 +25,19 @@ matrix:
- jdk: oraclejdk8
env: BUILD=BAZEL
+ - jdk: oraclejdk8
+ env: BUILD=GRADLE
+
before_install:
- case "$BUILD" in
"BAZEL")
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list ;
curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add - ;
sudo apt-get update ;;
+ "GRADLE")
+ mkdir -p $HOME/.gradle ;
+ echo "checkstyle.ignoreFailures=false" >> $HOME/.gradle/gradle.properties ;
+ echo "failOnWarnings=true" >> $HOME/.gradle/gradle.properties ;;
esac
install:
@@ -64,6 +71,9 @@ script:
- case "$BUILD" in
"BAZEL")
bazel test ... --javacopt=-Werror --javacopt=-Xlint:all --javacopt=-Xlint:-cast --javacopt=-Xlint:-deprecation --javacopt=-Xlint:-try --javacopt=-Xlint:-rawtypes --javacopt=-Xlint:-serial --javacopt=-Xlint:-unchecked --config=error_prone_warnings --config=error_prone_experimental_warnings ;;
+ "GRADLE")
+ ./gradlew clean assemble --stacktrace ;
+ ./gradlew check :instrumentation-all:jacocoTestReport --stacktrace ;;
"MVN")
case "$TRAVIS_JDK_VERSION" in
"oraclejdk8")
@@ -77,3 +87,21 @@ script:
exit 1 ;;
esac
esac
+
+after_success:
+ - case "$BUILD" in
+ "GRADLE")
+ ./gradlew :instrumentation-all:coveralls --stacktrace ;
+ bash <(curl -s https://codecov.io/bash) ;;
+ *)
+ echo "No GRADLE" ;;
+ esac
+
+before_cache:
+ - rm -fr $HOME/.gradle/caches/modules-2/modules-2.lock
+
+cache:
+ directories:
+ - $HOME/.gradle
+ - $HOME/.gradle/caches/
+ - $HOME/.gradle/wrapper/
diff --git a/all/build.gradle b/all/build.gradle
new file mode 100644
index 00000000..14cfe888
--- /dev/null
+++ b/all/build.gradle
@@ -0,0 +1,73 @@
+apply plugin: 'com.github.kt3k.coveralls'
+
+description = "Instrumentation: All"
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
+ }
+}
+
+def subprojects = [
+ project(':instrumentation-core'),
+ project(':instrumentation-core-context-impl'),
+ project(':instrumentation-core-impl'),
+]
+
+for (subproject in rootProject.subprojects) {
+ if (subproject == project) {
+ continue
+ }
+ evaluationDependsOn(subproject.path)
+}
+
+dependencies {
+ compile subprojects
+}
+
+javadoc {
+ classpath = files(subprojects.collect { subproject ->
+ subproject.javadoc.classpath
+ })
+ for (subproject in subprojects) {
+ if (subproject == project) {
+ continue;
+ }
+ source subproject.javadoc.source
+ options.links subproject.javadoc.options.links.toArray(new String[0])
+ }
+}
+
+task jacocoMerge(type: JacocoMerge) {
+ dependsOn(subprojects.jacocoTestReport.dependsOn)
+ mustRunAfter(subprojects.jacocoTestReport.mustRunAfter)
+ destinationFile = file("${buildDir}/jacoco/test.exec")
+ executionData = files(subprojects.jacocoTestReport.executionData)
+ .filter { f -> f.exists() }
+}
+
+jacocoTestReport {
+ dependsOn(jacocoMerge)
+ reports {
+ xml.enabled = true
+ html.enabled = true
+ }
+
+ additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
+ sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
+ classDirectories = files(subprojects.sourceSets.main.output)
+ classDirectories = files(classDirectories.files.collect {
+ fileTree(dir: it)
+ })
+}
+
+coveralls {
+ sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
+}
+
+tasks.coveralls {
+ dependsOn(jacocoTestReport)
+}
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 00000000..8005a56d
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,131 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ mavenLocal()
+ maven {
+ url "https://plugins.gradle.org/m2/"
+ }
+ }
+ dependencies {
+ classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.9'
+ }
+}
+
+subprojects {
+ apply plugin: "checkstyle"
+ apply plugin: 'maven'
+ apply plugin: 'idea'
+ apply plugin: 'java'
+ apply plugin: "signing"
+ apply plugin: "jacoco"
+ // TODO(bdrutu): enable all checks.
+ apply plugin: "net.ltgt.errorprone"
+
+ group = "com.google.instrumentation"
+ version = "0.4.0-SNAPSHOT" // CURRENT_INSTRUMENTATION_VERSION
+
+ sourceCompatibility = 1.6
+ targetCompatibility = 1.6
+
+ repositories {
+ mavenCentral()
+ mavenLocal()
+ }
+
+ [compileJava, compileTestJava].each() {
+ it.options.compilerArgs += ["-Xlint:all", "-Xlint:-try"]
+ it.options.encoding = "UTF-8"
+ if (rootProject.hasProperty('failOnWarnings') && rootProject.failOnWarnings.toBoolean()) {
+ it.options.compilerArgs += ["-Werror"]
+ }
+ }
+
+ compileTestJava {
+ // serialVersionUID is basically guaranteed to be useless in tests
+ options.compilerArgs += ["-Xlint:-serial"]
+ // It undeprecates DoubleSubject.isEqualTo(Double).
+ options.compilerArgs += ["-Xlint:-deprecation"]
+ sourceCompatibility = 1.7
+ targetCompatibility = 1.7
+ }
+
+ jar.manifest {
+ attributes('Implementation-Title': name,
+ 'Implementation-Version': version,
+ 'Built-By': System.getProperty('user.name'),
+ 'Built-JDK': System.getProperty('java.version'),
+ 'Source-Compatibility': sourceCompatibility,
+ 'Target-Compatibility': targetCompatibility)
+ }
+
+ javadoc.options {
+ encoding = 'UTF-8'
+ links 'https://docs.oracle.com/javase/8/docs/api/'
+ }
+
+ ext {
+ guavaVersion = '19.0'
+ protobufVersion = '3.2.0'
+ grpcContextVersion = '1.1.2'
+
+ libraries = [
+ errorprone : 'com.google.errorprone:error_prone_annotations:2.0.11',
+ grpc_context : "io.grpc:grpc-context:${grpcContextVersion}",
+ guava : "com.google.guava:guava:${guavaVersion}",
+ jsr305 : 'com.google.code.findbugs:jsr305:3.0.0',
+ protobuf : "com.google.protobuf:protobuf-java:${protobufVersion}",
+
+ // Test dependencies.
+ guava_testlib: "com.google.guava:guava-testlib:${guavaVersion}",
+ junit : 'junit:junit:4.11',
+ mockito : 'org.mockito:mockito-core:1.9.5',
+ truth : 'com.google.truth:truth:0.30',
+ ]
+ }
+
+ dependencies {
+ testCompile libraries.guava_testlib,
+ libraries.junit,
+ libraries.mockito,
+ libraries.truth
+
+ // The ErrorProne plugin defaults to the latest, which would break our
+ // build if error prone releases a new version with a new check
+ errorprone 'com.google.errorprone:error_prone_core:2.0.19'
+ }
+
+ checkstyle {
+ configFile = file("$rootDir/checkstyle.xml")
+ toolVersion = "7.6"
+ ignoreFailures = false
+ if (rootProject.hasProperty("checkstyle.ignoreFailures")) {
+ ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean()
+ }
+ configProperties["rootDir"] = rootDir
+ }
+
+ checkstyleMain {
+ // This skips proto generated files beucasue they are in gen_gradle/src/main/**
+ source = fileTree(dir: "src/main", include: "**/*.java")
+ }
+ checkstyleMain.onlyIf { !name.contains("proto") && !name.contains("shared")}
+
+ checkstyleTest {
+ // TODO(bdrutu): Enable this when we have tests checkstyle clean.
+ // source = fileTree(dir: "src/test", include: "**/*.java")
+ excludes = ["**"]
+ }
+ checkstyleTest.onlyIf { !name.contains("proto") && !name.contains("shared")}
+
+ // At a test failure, log the stack trace to the console so that we don't
+ // have to open the HTML in a browser.
+ test {
+ testLogging {
+ exceptionFormat = 'full'
+ showExceptions true
+ showCauses true
+ showStackTraces true
+ }
+ maxHeapSize = '1500m'
+ }
+}
diff --git a/checkstyle.xml b/checkstyle.xml
new file mode 100644
index 00000000..45f05489
--- /dev/null
+++ b/checkstyle.xml
@@ -0,0 +1,219 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+ Checkstyle configuration that checks the Google coding conventions from Google Java Style
+ that can be found at https://google.github.io/styleguide/javaguide.html.
+
+ Checkstyle is very configurable. Be sure to read the documentation at
+ http://checkstyle.sf.net (or in your downloaded distribution).
+
+ To completely disable a check, just comment it out or delete it from the file.
+
+ Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
+ -->
+
+<module name = "Checker">
+ <property name="charset" value="UTF-8"/>
+
+ <property name="severity" value="error"/>
+
+ <property name="fileExtensions" value="java, properties, xml"/>
+ <!-- Checks for whitespace -->
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+ <module name="FileTabCharacter">
+ <property name="eachLine" value="true"/>
+ </module>
+
+ <module name="TreeWalker">
+ <module name="OuterTypeFilename"/>
+ <module name="IllegalTokenText">
+ <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
+ <property name="format" value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
+ <property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
+ </module>
+ <module name="AvoidEscapedUnicodeCharacters">
+ <property name="allowEscapesForControlCharacters" value="true"/>
+ <property name="allowByTailComment" value="true"/>
+ <property name="allowNonPrintableEscapes" value="true"/>
+ </module>
+ <module name="LineLength">
+ <property name="max" value="100"/>
+ <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+ </module>
+ <module name="AvoidStarImport"/>
+ <module name="OneTopLevelClass"/>
+ <module name="NoLineWrap"/>
+ <module name="EmptyBlock">
+ <property name="option" value="TEXT"/>
+ <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
+ </module>
+ <module name="NeedBraces"/>
+ <module name="LeftCurly">
+ <property name="maxLineLength" value="100"/>
+ </module>
+ <module name="RightCurly">
+ <property name="id" value="RightCurlySame"/>
+ <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
+ </module>
+ <module name="RightCurly">
+ <property name="id" value="RightCurlyAlone"/>
+ <property name="option" value="alone"/>
+ <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="allowEmptyConstructors" value="true"/>
+ <property name="allowEmptyMethods" value="true"/>
+ <property name="allowEmptyTypes" value="true"/>
+ <property name="allowEmptyLoops" value="true"/>
+ <message key="ws.notFollowed"
+ value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
+ <message key="ws.notPreceded"
+ value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+ </module>
+ <module name="OneStatementPerLine"/>
+ <module name="MultipleVariableDeclarations"/>
+ <module name="ArrayTypeStyle"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="FallThrough"/>
+ <module name="UpperEll"/>
+ <module name="ModifierOrder"/>
+ <module name="EmptyLineSeparator">
+ <property name="allowNoEmptyLineBetweenFields" value="true"/>
+ </module>
+ <module name="SeparatorWrap">
+ <property name="id" value="SeparatorWrapDot"/>
+ <property name="tokens" value="DOT"/>
+ <property name="option" value="nl"/>
+ </module>
+ <module name="SeparatorWrap">
+ <property name="id" value="SeparatorWrapComma"/>
+ <property name="tokens" value="COMMA"/>
+ <property name="option" value="EOL"/>
+ </module>
+ <module name="PackageName">
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+ <message key="name.invalidPattern"
+ value="Package name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="TypeName">
+ <message key="name.invalidPattern"
+ value="Type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="MemberName">
+ <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+ <message key="name.invalidPattern"
+ value="Member name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="ParameterName">
+ <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
+ <message key="name.invalidPattern"
+ value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="CatchParameterName">
+ <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
+ <message key="name.invalidPattern"
+ value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="LocalVariableName">
+ <property name="tokens" value="VARIABLE_DEF"/>
+ <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
+ <message key="name.invalidPattern"
+ value="Local variable name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="ClassTypeParameterName">
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern"
+ value="Class type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="MethodTypeParameterName">
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern"
+ value="Method type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="InterfaceTypeParameterName">
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern"
+ value="Interface type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="NoFinalizer"/>
+ <module name="GenericWhitespace">
+ <message key="ws.followed"
+ value="GenericWhitespace ''{0}'' is followed by whitespace."/>
+ <message key="ws.preceded"
+ value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
+ <message key="ws.illegalFollow"
+ value="GenericWhitespace ''{0}'' should followed by whitespace."/>
+ <message key="ws.notPreceded"
+ value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
+ </module>
+ <module name="Indentation">
+ <property name="basicOffset" value="2"/>
+ <property name="braceAdjustment" value="0"/>
+ <property name="caseIndent" value="2"/>
+ <property name="throwsIndent" value="4"/>
+ <property name="lineWrappingIndentation" value="4"/>
+ <property name="arrayInitIndent" value="2"/>
+ </module>
+ <module name="AbbreviationAsWordInName">
+ <property name="ignoreFinal" value="false"/>
+ <property name="allowedAbbreviationLength" value="1"/>
+ </module>
+ <module name="OverloadMethodsDeclarationOrder"/>
+ <module name="VariableDeclarationUsageDistance"/>
+ <module name="CustomImportOrder">
+ <property name="sortImportsInGroupAlphabetically" value="true"/>
+ <property name="separateLineBetweenGroups" value="true"/>
+ <property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
+ </module>
+ <module name="MethodParamPad"/>
+ <module name="ParenPad"/>
+ <module name="OperatorWrap">
+ <property name="option" value="NL"/>
+ <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
+ </module>
+ <module name="AnnotationLocation">
+ <property name="id" value="AnnotationLocationMostCases"/>
+ <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
+ </module>
+ <module name="AnnotationLocation">
+ <property name="id" value="AnnotationLocationVariables"/>
+ <property name="tokens" value="VARIABLE_DEF"/>
+ <property name="allowSamelineMultipleAnnotations" value="true"/>
+ </module>
+ <module name="NonEmptyAtclauseDescription"/>
+ <module name="JavadocTagContinuationIndentation"/>
+ <module name="SummaryJavadoc">
+ <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
+ </module>
+ <module name="JavadocParagraph"/>
+ <module name="AtclauseOrder">
+ <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
+ <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
+ </module>
+ <module name="JavadocMethod">
+ <property name="scope" value="public"/>
+ <property name="allowMissingParamTags" value="true"/>
+ <property name="allowMissingThrowsTags" value="true"/>
+ <property name="allowMissingReturnTag" value="true"/>
+ <property name="minLineCount" value="2"/>
+ <property name="allowedAnnotations" value="Override, Test"/>
+ <property name="allowThrowsTagsForSubclasses" value="true"/>
+ </module>
+ <module name="MethodName">
+ <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
+ <message key="name.invalidPattern"
+ value="Method name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+ <module name="SingleLineJavadoc">
+ <!-- TODO(bdrutu): Wrong interpretation of the style guide;
+ <property name="ignoreInlineTags" value="false"/-->
+ </module>
+ <module name="EmptyCatchBlock">
+ <property name="exceptionVariableName" value="expected"/>
+ </module>
+ <module name="CommentsIndentation"/>
+ </module>
+</module>
diff --git a/core/build.gradle b/core/build.gradle
new file mode 100644
index 00000000..da14e524
--- /dev/null
+++ b/core/build.gradle
@@ -0,0 +1,10 @@
+description = 'Instrumentation: Core'
+
+dependencies {
+ compile project(':shared'),
+ libraries.guava,
+ libraries.errorprone,
+ libraries.jsr305
+
+ testCompile project(':instrumentation-core-impl')
+}
diff --git a/core_context_impl/build.gradle b/core_context_impl/build.gradle
new file mode 100644
index 00000000..d88e1320
--- /dev/null
+++ b/core_context_impl/build.gradle
@@ -0,0 +1,9 @@
+description = 'Instrumentation Core Context Impl'
+
+dependencies {
+ compile project(':instrumentation-core'),
+ libraries.guava,
+ libraries.errorprone,
+ libraries.jsr305,
+ libraries.grpc_context
+}
diff --git a/core_impl/build.gradle b/core_impl/build.gradle
new file mode 100644
index 00000000..d79924dd
--- /dev/null
+++ b/core_impl/build.gradle
@@ -0,0 +1,9 @@
+description = 'Instrumentation Core Impl'
+
+dependencies {
+ compile project(':instrumentation-core'),
+ project(':proto'),
+ libraries.guava,
+ libraries.errorprone,
+ libraries.jsr305
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..2942b502
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..e560f34c
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat Mar 18 12:22:37 PDT 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 00000000..4453ccea
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# 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\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# 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
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+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" -a "$nonstop" = "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"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # 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
+
+# Escape application args
+save ( ) {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 00000000..e95643d6
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 00000000..0d26d20a
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,14 @@
+rootProject.name = "instrumentation"
+include ":instrumentation-core"
+include ":instrumentation-core-context-impl"
+include ":instrumentation-core-impl"
+include ":instrumentation-all"
+include ":proto"
+include ":shared"
+
+project(':instrumentation-all').projectDir = "$rootDir/all" as File
+project(':instrumentation-core').projectDir = "$rootDir/core" as File
+project(':instrumentation-core-context-impl').projectDir = "$rootDir/core_context_impl" as File
+project(':instrumentation-core-impl').projectDir = "$rootDir/core_impl" as File
+project(':proto').projectDir = "$rootDir/proto" as File
+project(':shared').projectDir = "$rootDir/shared" as File
diff --git a/shared/build.gradle b/shared/build.gradle
new file mode 100644
index 00000000..d50d1371
--- /dev/null
+++ b/shared/build.gradle
@@ -0,0 +1 @@
+description = 'Shared'