Skip to content

Commit ea3e25d

Browse files
alexeaglecopybara-github
authored andcommitted
GitHub PR#313 feat(docs): indicate how to use the new weekly snapshot pre-builds
-- 42b95a3 by Alex Eagle <[email protected]>: Update README.md -- 629f62f by Alex Eagle <[email protected]>: Update README.md -- 4d15cd3 by Alex Eagle <[email protected]>: feat(docs): indicate how to use the new weekly snapshot pre-builds Closes #313 GitOrigin-RevId: 94de53f Change-Id: Idffc09ec7556ab2fb3c38eb726f4998d97fc9970
1 parent 73e23e1 commit ea3e25d

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

README.md

+37-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@ $ copybara copy.bara.sky
7373

7474
## Getting Started using Copybara
7575

76-
Copybara doesn't have a release process yet, so you need to compile from HEAD.
76+
The easiest way to start is with weekly "snapshot" releases, that include pre-built a binary.
77+
Note that these are released automatically without any manual testing, version compatibility or correctness guarantees.
78+
79+
Choose a release from https://github.com/google/copybara/releases.
80+
81+
### Building from Source
82+
83+
To use an unreleased version of copybara, so you need to compile from HEAD.
7784
In order to do that, you need to do the following:
7885

7986
* [Install JDK 11](https://www.oracle.com/java/technologies/downloads/#java11).
@@ -120,7 +127,35 @@ targets:
120127
Note: configuration files can be stored in any place, even in a local folder.
121128
We recommend using a VCS (like git) to store them; treat them as source code.
122129

123-
### Building Copybara in an external Bazel workspace
130+
### Using pre-built Copybara in Bazel
131+
132+
If using a weekly snapshot release, install Copybara as follows:
133+
134+
1. Copybara ships with class files with version 65.0, so it must be run with Java Runtime 21 or greater. Add to your `.bazelrc` file: `run --java_runtime_version=remotejdk_21`
135+
2. Use `http_jar` to download the release artifact.
136+
- In WORKSPACE: `load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")`
137+
- In MODULE.bazel: `http_jar = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")`
138+
3. In WORKSPACE or MODULE.bazel, fill in the `[version]` placeholder:
139+
```starlark
140+
http_jar(
141+
name = "com_github_google_copybara",
142+
# Fill in from https://github.com/google/copybara/releases/download/[version]/copybara_deploy.jar.sha256
143+
# sha256 = "",
144+
urls = ["https://github.com/google/copybara/releases/download/[version]/copybara_deploy.jar"],
145+
)
146+
```
147+
4. In any BUILD file (perhaps `/tools/BUILD.bazel`) declare the `java_binary`:
148+
```starlark
149+
load("@rules_java//java:java_binary.bzl", "java_binary")
150+
java_binary(
151+
name = "copybara",
152+
main_class = "com.google.copybara.Main",
153+
runtime_deps = ["@com_github_google_copybara//jar"],
154+
)
155+
```
156+
5. Use that target with `bazel run`, for example `bazel run //tools:copybara -- migrate copy.bara.sky`
157+
158+
### Building Copybara from Source as an external Bazel repository
124159

125160
There are convenience macros defined for all of Copybara's dependencies. Add the
126161
following code to your `WORKSPACE` file, replacing `{{ sha256sum }}` and

third_party/bazel.bzl

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
# This file is autogenerated by copybara, please do not edit.
1716

1817
bazel_version = "73317d00065ba31d74fb7eaa647f5cc03e9df8cc"

0 commit comments

Comments
 (0)