Skip to content

Commit

Permalink
Open source pure native binary.
Browse files Browse the repository at this point in the history
See #127.

PiperOrigin-RevId: 687715496
  • Loading branch information
jwhpryor authored and copybara-github committed Oct 20, 2024
1 parent acce094 commit 19d8606
Show file tree
Hide file tree
Showing 8 changed files with 25,342 additions and 2 deletions.
26 changes: 26 additions & 0 deletions java/com/google/AddressFormatter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2021 Google LLC
*
* 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.
*/

package com.google;

/** Just a toy model to make sure that we have a large data structure in memory. */
class AddressFormatter {
public AddressFormatter() {}

public String format() {
return "tmp";
}
}
29 changes: 29 additions & 0 deletions java/com/google/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
load("@rules_java//java:defs.bzl", "java_library")

licenses(["notice"])

java_library(
name = "address_formatter_java",
srcs = ["AddressFormatter.java"],
data = [":address.txt"],
)

cc_library(
name = "address_formatter_cc",
hdrs = ["address_formatter.h"],
deps = [
"//:jni_bind",
"//:jni_dep",
],
)

cc_binary(
name = "address_formatter_main",
srcs = ["address_formatter_main.cc"],
data = [":address_formatter_java"],
deps = [
":address_formatter_cc",
"//:jni_bind",
"//:jni_dep",
],
)
3 changes: 3 additions & 0 deletions java/com/google/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This binary is meant to demonstrate a simple binary that is entirely written in native.

This is experimental.
Loading

0 comments on commit 19d8606

Please sign in to comment.