Skip to content

Commit

Permalink
Merge pull request #1 from cgruber/main
Browse files Browse the repository at this point in the history
Bring the geekinasuit fork up to date with cgruber's fork.
  • Loading branch information
cgruber authored Jun 17, 2020
2 parents 4de8f47 + 3fe20ac commit 848e881
Show file tree
Hide file tree
Showing 142 changed files with 1,901 additions and 950 deletions.
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.hg/
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build --javacopt=-Aautovaluegson.defaultCollectionsToEmpty=true
build --strategy=KotlinCompile=worker

1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.0
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
- main
- release*
pull_request:
branches:
- master
- main
jobs:
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Mount caches
uses: actions/cache@v2
with:
path: |
"/home/runner/.cache/bazel"
"/home/runner/.m2/repository"
key: caches-${{ runner.os }}
- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.5.0/bazelisk-darwin-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-darwin-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod a+x "${GITHUB_WORKSPACE}/bin/bazel"
echo "::set-env name=BAZELISK_GITHUB_TOKEN::${{ secrets.GITHUB_TOKEN }}"
"${GITHUB_WORKSPACE}/bin/bazel" version
- name: Build All
run: |
"${GITHUB_WORKSPACE}/bin/bazel" build //...
- name: Test All
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test //...
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Mount caches
uses: actions/cache@v2
with:
path: |
"/home/runner/.cache/bazel"
"/home/runner/.m2/repository"
key: caches-${{ runner.os }}
- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.5.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod a+x "${GITHUB_WORKSPACE}/bin/bazel"
echo "::set-env name=BAZELISK_GITHUB_TOKEN::${{ secrets.GITHUB_TOKEN }}"
"${GITHUB_WORKSPACE}/bin/bazel" version
- name: Build All
run: |
"${GITHUB_WORKSPACE}/bin/bazel" build //...
- name: Test All
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test //...
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
build/
# maven
target/

# eclipse
.project
.classpath
.settings/
.factorypath

# Idea/AndroidStudio
.idea/
*.iml
*.ipr

#Bazel
bazel-*
.aswb/
.ijwb/
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exports_files([
"build_substitution_templates.bzl",
])
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ note that a Google, Inc. copyright line must appear in every copyright notice.
All files are released with the Apache 2.0 license and any new files may only
be accepted under the terms of that license.



Before your code can be accepted into the project you must sign the
[Individual Contributor License Agreement (CLA)][1].

Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributors

These authors have supplied code or other contributions to this repository.

- Google, Inc.
- various employees
- Christian Gruber

> Note: If your contribution is not accounted for here, please submit a pull request with an update.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
*Make Open Easy*

[![LICENSE](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/google/MOE/blob/master/LICENSE)
[![Travis CI](https://img.shields.io/travis/google/MOE.svg)](https://travis-ci.org/google/MOE)
[![GitHub Issues](https://img.shields.io/github/issues/google/MOE.svg)](https://github.com/google/MOE/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/google/MOE.svg)](https://github.com/google/MOE/pulls)
[![CI](https://github.com/cgruber/MOE/workflows/CI/badge.svg)](https://github.com/cgruber/MOE/actions?query=workflow%3ACI)
[![GitHub Issues](https://img.shields.io/github/issues/cgruber/MOE.svg)](https://github.com/cgruber/MOE/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/cgruber/MOE.svg)](https://github.com/cgruber/MOE/pulls)

> Note: This is a personal fork by [cgruber](http://github.com/cgruber)
## Introduction

Expand Down Expand Up @@ -37,13 +39,12 @@ documentation update, which is forthcoming.

### Building MOE

1. Install Apache Maven 3.1 if you don't already have it
1. Install [Bazelisk](http://github.com/bazelbuild/bazelisk)
2. Checkout the Java-MOE source `git clone [email protected]:google/MOE.git`
3. In the top-level directory that contains the build.xml file, run:
- `mvn install`
- `util/make-binary.sh`
4. The moe client binary should be created at `client/target/moe`

3. In the top level directory that contains the WORKSPACE file, run:
- `bazel build //client:moe`
4. The moe client binary should be created at `bazel-bin/client/moe`
5. (optionally) install the client somewhere in your `$PATH`

### Running MOE

Expand All @@ -52,16 +53,12 @@ Once you have the `moe` binary, you should be able to simply run:

## Contributing

Contributing to MOE is subject to the guidelines in the CONTRIBUTING.md file,
which, in brief, requires that contributors sign the [Individual Contributor
License Agreement (CLA)][CLA].

[CLA]: https://cla.developers.google.com/

Contributing to MOE is subject to the guidelines in the CONTRIBUTING.md file

## License

```
Copyright 2011 The Moe Authors. All Rights Reserved.
Copyright 2011 Google, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
102 changes: 102 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
workspace(name = "moe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Rules and tooling versions
RULES_KOTLIN_VERSION = "legacy-1.4.0-rc3"
RULES_KOTLIN_SHA = "da0e6e1543fcc79e93d4d93c3333378f3bd5d29e82c1bc2518de0dbe048e6598"


MAVEN_REPOSITORY_RULES_VERSION = "2.0.0-alpha-3"
MAVEN_REPOSITORY_RULES_SHA = "853976a2e4908f010568aad8f47b1a1e87e258f33b114e6e92599dc2779938c4"
KOTLIN_VERSION = "1.3.72"
KOTLINC_ROOT = "https://github.com/JetBrains/kotlin/releases/download"
KOTLINC_URL = "{root}/v{v}/kotlin-compiler-{v}.zip".format(root = KOTLINC_ROOT, v = KOTLIN_VERSION)
KOTLINC_SHA = "ccd0db87981f1c0e3f209a1a4acb6778f14e63fe3e561a98948b5317e526cc6c"


# Rules and tools repositories
http_archive(
name = "io_bazel_rules_kotlin",
sha256 = RULES_KOTLIN_SHA,
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % RULES_KOTLIN_VERSION],
)

http_archive(
name = "maven_repository_rules",
sha256 = MAVEN_REPOSITORY_RULES_SHA,
strip_prefix = "bazel_maven_repository-%s" % MAVEN_REPOSITORY_RULES_VERSION,
type = "zip",
urls = ["https://github.com/square/bazel_maven_repository/archive/%s.zip" % MAVEN_REPOSITORY_RULES_VERSION],
)

# Setup Kotlin
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
kotlin_repositories(compiler_release = { "urls": [KOTLINC_URL], "sha256": KOTLINC_SHA })
kt_register_toolchains()


# Setup maven repository handling.
load("@maven_repository_rules//maven:maven.bzl", "maven_repository_specification")
load(":workspace_maven_substitutes.bzl", "snippets")
maven_repository_specification(
name = "maven",
artifacts = {
"args4j:args4j:2.32": { "insecure": True },
"cglib:cglib-nodep:2.2.2": { "insecure": True },
"com.google.auto.factory:auto-factory:1.0-beta6": {
"insecure": True,
"build_snippet": snippets.AUTO_FACTORY.format(version = "1.0-beta6"),
},
"com.google.auto.value:auto-value-annotations:1.6.3": { "insecure": True },
"com.google.auto.value:auto-value:1.6.3": {
"insecure": True,
"build_snippet": snippets.AUTO_VALUE.format(version = "1.6.3"),
},
"com.google.auto:auto-common:0.10": { "insecure": True },
"com.google.code.findbugs:jsr305:3.0.2": { "insecure": True },
"com.google.code.gson:gson:2.8.1": { "insecure": True },
"com.google.dagger:dagger-compiler:2.21": { "insecure": True },
"com.google.dagger:dagger-producers:2.21": { "insecure": True },
"com.google.dagger:dagger-spi:2.21": { "insecure": True },
"com.google.dagger:dagger:2.21": {
"insecure": True,
"build_snippet": snippets.DAGGER.format(version = "2.21"),
},
"com.google.errorprone:error_prone_annotations:2.3.1": { "insecure": True },
"com.google.errorprone:javac-shaded:9+181-r4173-1": { "insecure": True },
"com.google.googlejavaformat:google-java-format:1.6": { "insecure": True },
"com.google.guava:guava:27.0.1-jre": { "insecure": True },
"com.google.guava:failureaccess:1.0.1": { "insecure": True },
"com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava": { "insecure": True },
"com.google.j2objc:j2objc-annotations:1.1": { "insecure": True },
"com.google.truth:truth:0.42": { "insecure": True },
"com.googlecode.java-diff-utils:diffutils:1.3.0": { "insecure": True },
"com.mikesamuel:json-sanitizer:1.1": { "insecure": True },
"com.nhaarman:mockito-kotlin:1.6.0": { "insecure": True },
"com.ryanharter.auto.value:auto-value-gson-annotations:0.8.0": { "insecure": True },
"com.ryanharter.auto.value:auto-value-gson:0.8.0": { "insecure": True },
"com.squareup.okhttp:okhttp:2.5.0": { "insecure": True },
"com.squareup.okio:okio:1.6.0": { "insecure": True },
"com.squareup:javapoet:1.11.1": { "insecure": True },
"javax.annotation:jsr250-api:1.0": { "insecure": True },
"javax.inject:javax.inject:1": { "insecure": True },
"joda-time:joda-time:2.9.9": { "insecure": True },
"junit:junit:4.13-beta-1": { "insecure": True },
"net.bytebuddy:byte-buddy:1.9.7": { "insecure": True },
"net.bytebuddy:byte-buddy-agent:1.9.7": { "insecure": True },
"org.checkerframework:checker-compat-qual:2.5.3": { "insecure": True },
"org.checkerframework:checker-qual:2.5.3": { "insecure": True },
"org.codehaus.mojo:animal-sniffer-annotations:1.14": { "insecure": True },
"org.easymock:easymock:3.1": { "insecure": True },
"org.jetbrains:annotations:13.0": { "insecure": True },
"org.jetbrains.kotlin:kotlin-reflect:%s" % KOTLIN_VERSION: { "insecure": True },
"org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION: { "insecure": True },
"org.jetbrains.kotlin:kotlin-stdlib-common:%s" % KOTLIN_VERSION: { "insecure": True },
"org.mockito:mockito-core:2.24.0": { "insecure": True },
"org.objenesis:objenesis:2.6": { "insecure": True },
"org.hamcrest:hamcrest-core:1.3": { "insecure": True },
},
dependency_target_substitutes = {
"com.google.dagger": {"@maven//com/google/dagger:dagger": "@maven//com/google/dagger:dagger-api"},
},
)
17 changes: 17 additions & 0 deletions client/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library", "kt_jvm_binary")

java_binary(
name = "client-bin",
main_class = "com.google.devtools.moe.client.Moe",
runtime_deps = ["//client/src/main/java/com/google/devtools/moe/client"],
)

genrule(
name = "moe",
outs = ["moe"],
srcs = [
"//util:java-exec-prefix",
":client-bin_deploy.jar"
],
cmd_bash = "cat $(location //util:java-exec-prefix) $(location :client-bin_deploy.jar) > $@",
)
Loading

0 comments on commit 848e881

Please sign in to comment.