Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into cwoodward/merge-u…
Browse files Browse the repository at this point in the history
…pstream

* upstream/master: (25 commits)
  Skip OkBuck if we just want to run buck help. (uber#470)
  Set WORKING_DIR to the location of the buck wrapper. (uber#471)
  Publish v0.22.4
  Add logic to buckw to update buck and build it if needed (uber#469)
  Use relative path for merged proguard file
  Publish v0.22.3
  Better error message
  Allow transform config to accept project dependencies (uber#466)
  Remove unused parameters and clean up some code. (uber#439)
  Publish v0.22.2
  Do not generate default project ignores
  Setup Kotlin home whenever the kotlin gradle plugin is on the classpath. (uber#464)
  Update several dependencies to latest (uber#462)
  Remove kotlin-dev repo as 1.1.3 is now released
  Add support for mixed kotlin and java in regular kotlin modules. (uber#461)
  Publish v0.22.1
  Fix rule type propagation
  Publish v0.22.0
  Update kotlin, gradle and buck versions (uber#460)
  Add kotlin android integration test and fixup source detection (uber#459)
  ...
  • Loading branch information
Chris Woodward committed Jul 18, 2017
2 parents 24f2265 + 19a4c2e commit de10813
Show file tree
Hide file tree
Showing 63 changed files with 355 additions and 791 deletions.
2 changes: 1 addition & 1 deletion .buckversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
800d5a9669417d5a8b4bc455e34a629422ed1ff1
f685044b764341d952491529c167403e3c3adba6
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android:
- tools
- platform-tools
- tools
- build-tools-25.0.1
- android-25
- build-tools-26.0.0
- android-26
- extra-android-m2repository

before_script:
Expand Down
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.uber:okbuck:0.21.0'
classpath 'com.uber:okbuck:0.22.4'
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.uber:okbuck:0.21.0'
classpath 'com.uber:okbuck:0.22.4'
}
}
Expand Down
Binary file modified app/aars/rxscreenshotdetector-release.aar
Binary file not shown.
37 changes: 23 additions & 14 deletions app/src/main/java/com/uber/okbuck/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

import com.github.piasy.rxscreenshotdetector.RxScreenshotDetector;
import com.promegu.xlog.base.XLog;
import com.uber.okbuck.example.common.Calc;
import com.uber.okbuck.example.common.CalcMonitor;
import com.uber.okbuck.example.common.IMyAidlInterface;
import com.uber.okbuck.example.dummylibrary.DummyActivity;
import com.uber.okbuck.example.dummylibrary.DummyAndroidClass;
import com.uber.okbuck.example.javalib.DummyJavaClass;
import com.github.piasy.rxscreenshotdetector.RxScreenshotDetector;
import com.uber.okbuck.example.sqldelightmodel.GithubRepo;
import com.uber.okbuck.example.sqldelightmodel.GithubUser;
import com.promegu.xlog.base.XLog;
import com.uber.okbuck.kotlin.JavaClass;
import com.uber.okbuck.java.Pojo;
import com.uber.okbuck.kotlin.KotlinDataClass;

import javax.inject.Inject;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

@XLog
public class MainActivity extends AppCompatActivity {
Expand Down Expand Up @@ -77,12 +81,12 @@ protected void onCreate(Bundle savedInstanceState) {

Log.d("test", "1 + 2 = " + new Calc(new CalcMonitor(this)).add(1, 2));

RxScreenshotDetector.start(getApplicationContext())
RxScreenshotDetector.start(this)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<String>() {
.subscribe(new Observer<String>() {
@Override
public void onCompleted() {
public void onComplete() {

}

Expand All @@ -95,14 +99,19 @@ public void onError(Throwable e) {
public void onNext(String path) {
mTextView.setText(mTextView.getText() + "\nScreenshot: " + path);
}

@Override
public void onSubscribe(Disposable disposable) {

}
});
GithubUser user = GithubUser.create(100, "OkBuck");
Toast.makeText(this, user.login(), Toast.LENGTH_SHORT).show();
GithubRepo repo = GithubRepo.create(100, "OkBuck", "auto buck");
Toast.makeText(this, repo.name() + ": " + repo.description(), Toast.LENGTH_SHORT).show();

new KotlinDataClass("foo", R.string.foo);
new JavaClass().foo();
KotlinDataClass data = new KotlinDataClass("foo", R.string.foo);
Pojo pojo = new Pojo();
}

@Override
Expand Down
32 changes: 26 additions & 6 deletions buckw
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
##
## Buck wrapper script to invoke okbuck when needed, before running buck
##
## Created by OkBuck Gradle Plugin on : Wed Apr 19 21:13:00 PDT 2017
## Created by OkBuck Gradle Plugin on : Fri Jul 14 10:17:41 PDT 2017
##
#########################################################################

WORKING_DIR=$(pwd)
WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

red=`tput setab 1 2>/dev/null || true`
yellow=`tput setab 3 2>/dev/null || true`
Expand Down Expand Up @@ -162,6 +162,26 @@ setupBuckBinary ( ) {
cd -
fi
# Check for current buck version
BUCK_VERSION=$(cat .buckversion)
if [[ ! -z "$BUCK_VERSION" ]]; then
pushd "$BUCK_HOME" >/dev/null
CURRENT_BUCK_VERSION=$(git rev-parse HEAD)
if [[ "$BUCK_VERSION" != "$CURRENT_BUCK_VERSION" ]]; then
info "BUCK VERSION IS AT $CURRENT_BUCK_VERSION , BUT IT SHOULD BE $BUCK_VERSION. UPDATING BUCK"
git clean -fdx --quiet && git reset --hard --quiet && git fetch --all && git checkout "$BUCK_VERSION" --quiet
fi
popd >/dev/null
fi
# Build buck if needed
if [[ ! -f "$BUCK_HOME/build/successful-build" ]]; then
echo "Buck does not appear to have been built -- building Buck!"
pushd "$BUCK_HOME" >/dev/null
mkdir -p build && ant > build/ant.log && success "BUCK BUILT SUCCESFULLY" || die "FAILED TO BUILD BUCK"
popd >/dev/null
fi
BUCK_BINARY="$BUCK_HOME/bin/buck"
fi
}
Expand Down Expand Up @@ -193,10 +213,10 @@ setupBuckRun ( ) {
# Handle parameters and flags
handleParams ( ) {
# Go directly to kill. Do not run okbuck.
if [[ "kill" == $1 ]]; then
SKIP_OKBUCK=true
fi
# Go directly to the kill command, help command, or --help option. Do not run okbuck.
if [[ "kill" == $1 || "help" == $1 || $@ == *"--help"* || $@ == *"-h"* ]]; then
SKIP_OKBUCK=true
fi
}
handleParams "$@"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}

def publishVersion = '0.21.0-SQUARE-1'
def publishVersion = '0.22.4'
group = 'com.uber'
version = publishVersion
def siteUrl = 'https://github.com/uber/okbuck'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ final class AndroidLibraryRuleComposer extends AndroidBuckRuleComposer {
}

return new AndroidLibraryRule(
target.ruleType,
src(target),
["PUBLIC"],
libraryDeps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ final class AndroidTestRuleComposer extends AndroidBuckRuleComposer {
}

return new AndroidTestRule(
target.testRuleType,
test(target),
["PUBLIC"],
testDeps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class ExopackageAndroidLibraryRuleComposer extends AndroidBuckRuleComposer
deps.add(":${buildConfig(target)}")

return new ExopackageAndroidLibraryRule(
target.ruleType,
appLib(target),
target.exopackage.appClass,
["PUBLIC"],
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ final class JavaBinaryRuleComposer extends JvmBuckRuleComposer {
}

static JavaBinaryRule compose(JavaAppTarget target) {
return new JavaBinaryRule(bin(target), ["PUBLIC"], [":${src(target)}"], target.mainClass, target.excludes,
target.getExtraOpts(RuleType.JAVA_BINARY))
return new JavaBinaryRule(bin(target), ["PUBLIC"], [":${src(target)}"], target.mainClass,
target.excludes, target.getExtraOpts(RuleType.JAVA_BINARY))
}

private static String bin(final JavaTarget target) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ final class JavaLibraryRuleComposer extends JvmBuckRuleComposer {
// no instance
}

static JavaLibraryRule compose(JavaLibTarget target) {
static JavaLibraryRule compose(JavaLibTarget target,
RuleType ruleType = RuleType.JAVA_LIBRARY) {
List<String> deps = []
deps.addAll(external(target.main.externalDeps))
deps.addAll(targets(target.main.targetDeps))
Expand All @@ -36,6 +37,7 @@ final class JavaLibraryRuleComposer extends JvmBuckRuleComposer {
}

new JavaLibraryRule(
ruleType,
src(target),
["PUBLIC"],
deps,
Expand All @@ -49,6 +51,6 @@ final class JavaLibraryRuleComposer extends JvmBuckRuleComposer {
target.postprocessClassesCommands,
target.main.jvmArgs,
testTargets,
target.getExtraOpts(RuleType.JAVA_LIBRARY))
target.getExtraOpts(ruleType))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ final class JavaTestRuleComposer extends JvmBuckRuleComposer {
// no instance
}

static JavaTestRule compose(JavaLibTarget target) {
static JavaTestRule compose(JavaLibTarget target,
RuleType ruleType = RuleType.JAVA_TEST) {
List<String> deps = []
deps.add(":${src(target)}")
deps.addAll(external(target.test.externalDeps))
Expand All @@ -32,6 +33,7 @@ final class JavaTestRuleComposer extends JvmBuckRuleComposer {
}

new JavaTestRule(
ruleType,
test(target),
["PUBLIC"],
deps,
Expand All @@ -45,6 +47,6 @@ final class JavaTestRuleComposer extends JvmBuckRuleComposer {
target.postprocessClassesCommands,
target.test.jvmArgs,
target.testOptions,
target.getExtraOpts(RuleType.JAVA_TEST))
target.getExtraOpts(ruleType))
}
}

This file was deleted.

Loading

0 comments on commit de10813

Please sign in to comment.