Skip to content

Commit

Permalink
Deleted unremoved occurrences of internship in BUILD files
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHuertas committed Dec 3, 2024
1 parent 282ff15 commit 1f4c666
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 33 deletions.
5 changes: 1 addition & 4 deletions java/com/engflow/binaryinput/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ NUM_FILES = 1
[genrule(
name = "Hello" + str(x),
outs = ["Hello" + str(x) + ".java"],
cmd_bash = "echo 'package com.engflow.internship.binaryinput;" + "\n" +
cmd_bash = "echo 'package com.engflow.binaryinput;" + "\n" +
"public class Hello" + str(x) +
" { public static void greetNum() { System.out.println(\"Hello " + str(x) + "\"); } }' > $@",
#cmd_ps = "echo 'package com.engflow.internship.binaryinput;" + "\n" +
# "public class Hello" + str(x) +
# " { public static void greetNum() { System.out.println(\"Hello " + str(x) + "\"); } }' > $($outputFile.FullName)",
) for x in range(1,NUM_FILES+1)]

#Generates a java library that contains all the generated java files
Expand Down
2 changes: 1 addition & 1 deletion java/com/engflow/binaryinput/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static void main(String[] args) {

// Load and run the greetNum method from each class
for(int i = 1; i <= numFiles; i++){
Class<?> clazz = Class.forName("com.engflow.internship.binaryinput.Hello" + i);
Class<?> clazz = Class.forName("com.engflow.binaryinput.Hello" + i);
clazz.getMethod("greetNum").invoke(null);
}

Expand Down
14 changes: 7 additions & 7 deletions java/com/engflow/binaryinput/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ The goal of this example project is to test the performance of Engflow's remote

## Project Structure

- `java/com/engflow/internship/binaryinput/Main.java`: Main class that dynamically loads and invokes methods from generated classes.
- `java/com/engflow/internship/binaryinput/BUILD`: Bazel build file for the `main` java binary and the `genbinary` library.
- `java/com/engflow/binaryinput/Main.java`: Main class that dynamically loads and invokes methods from generated classes.
- `java/com/engflow/binaryinput/BUILD`: Bazel build file for the `main` java binary and the `genbinary` library.

## Usage

To generate the test files, build the `genbinary` library using the `genrule`:
```sh
bazel build //java/com/engflow/internship/binaryinput:genbinary
bazel build //java/com/engflow/binaryinput:genbinary
```

Then, the program can be run with the following command:
```sh
bazel run //java/com/engflow/internship/binaryinput:main
bazel run //java/com/engflow/binaryinput:main
```

## How It Works
Expand All @@ -39,14 +39,14 @@ The number of generated files is controlled by the `NUM_FILES` variable in the `

To generate and run the program with 10 input binary files:

1. Set `NUM_FILES` to 10 in `java/com/engflow/internship/binaryinput/BUILD`.
1. Set `NUM_FILES` to 10 in `java/com/engflow/binaryinput/BUILD`.
2. Build the `genbinary` library:
```sh
bazel build //java/com/engflow/internship/binaryinput:genbinary
bazel build //java/com/engflow/binaryinput:genbinary
```
3. Run the `main` binary:
```sh
bazel run //java/com/engflow/internship/binaryinput:main
bazel run //java/com/engflow/binaryinput:main
```

This will generate 10 Java classes, build the `genbinary` library, and run the `main` binary, which will print messages from each generated class.
2 changes: 1 addition & 1 deletion java/com/engflow/cycleexample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ The program takes a text input file and recursively prints each word with each c
To run the tests and gather performance data, use the following Bazel command:

```sh
bazel test //java/com/engflow/internship/cycleexample/class_a:class_a_test
bazel test //java/com/engflow/cycleexample/class_a:class_a_test
2 changes: 1 addition & 1 deletion java/com/engflow/cycleexample/class_a/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ java_library(
java_test(
name = "class_a_test",
srcs = ["ClassATest.java"],
test_class = "com.engflow.internship.cycleexample.class_a.ClassATest",
test_class = "com.engflow.cycleexample.class_a.ClassATest",
deps = [
":class_a",
"//java/com/engflow/cycleexample/class_b:class_b",
Expand Down
2 changes: 1 addition & 1 deletion java/com/engflow/cycleexample/class_b/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ java_library(
java_test(
name = "class_b_test",
srcs = ["ClassBTest.java"],
test_class = "com.engflow.internship.cycleexample.class_b.ClassBTest",
test_class = "com.engflow.cycleexample.class_b.ClassBTest",
deps = [
":class_b",
"//java/com/engflow/cycleexample/class_c:class_c",
Expand Down
2 changes: 1 addition & 1 deletion java/com/engflow/cycleexample/class_c/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ java_library(
java_test(
name = "class_c_test",
srcs = ["ClassCTest.java"],
test_class = "com.engflow.internship.cycleexample.class_c.ClassCTest",
test_class = "com.engflow.cycleexample.class_c.ClassCTest",
deps = [
":class_c",
"//java/com/engflow/cycleexample/class_a:class_a",
Expand Down
2 changes: 1 addition & 1 deletion java/com/engflow/cycleexample/main/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ java_binary(
data = [
"//java/com/engflow/cycleexample/input:input",
],
main_class = "com.engflow.internship.cycleexample.main.Main",
main_class = "com.engflow.cycleexample.main.Main",
)
10 changes: 5 additions & 5 deletions java/com/engflow/setinput/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ The goal of this example project is to test the performance of Engflow's remote

## Project Structure

- `java/com/engflow/internship/setinput/genfile`: Directory where the `.txt` files generated by the genrule are stored.
- `java/com/engflow/internship/varyinginputs/main`: Contains the `Main` class which orchestrates the reading process.
- `java/com/engflow/internship/varyinginputs/reader`: Contains the `Reader` class responsible for reading the files.
- `java/com/engflow/setinput/genfile`: Directory where the `.txt` files generated by the genrule are stored.
- `java/com/engflow/varyinginputs/main`: Contains the `Main` class which orchestrates the reading process.
- `java/com/engflow/varyinginputs/reader`: Contains the `Reader` class responsible for reading the files.

## Usage

To generate the test files, build the filegroup target:
```sh
bazel build //java/com/engflow/internship/setinput/genfile
bazel build //java/com/engflow/setinput/genfile
```

Then, the program can be run with the following command:

```sh
bazel run //java/com/engflow/internship/varyinginputs/main
bazel run //java/com/engflow/varyinginputs/main
```

To modify the amount of files generated, change the value of the `NUM_FILES` in the `BUILD` file inside the `genfile` directory.
4 changes: 2 additions & 2 deletions java/com/engflow/setinput/main/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ java_binary(
deps = [
"//java/com/engflow/setinput/genreader:genreader",
],
data = glob(["java/com/engflow/internship/setinput/genfile/*.txt"]),
main_class = "com.engflow.internship.setinput.main.Main",
data = glob(["java/com/engflow/setinput/genfile/*.txt"]),
main_class = "com.engflow.setinput.main.Main",
)
12 changes: 6 additions & 6 deletions java/com/engflow/varyinginputs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ The goal of this example project is to test the performance of Engflow's remote

## Project Structure

- `java/com/engflow/internship/varyinginputs/input`: Directory where the generated `.txt` files are saved.
- `java/com/engflow/internship/varyinginputs/main`: Contains the `Main` class which orchestrates the file creation and reading process.
- `java/com/engflow/internship/varyinginputs/reader`: Contains the `Reader` class responsible for reading the files.
- `java/com/engflow/internship/varyinginputs/writer`: Contains the `Writer` class responsible for writing the files.
- `java/com/engflow/varyinginputs/input`: Directory where the generated `.txt` files are saved.
- `java/com/engflow/varyinginputs/main`: Contains the `Main` class which orchestrates the file creation and reading process.
- `java/com/engflow/varyinginputs/reader`: Contains the `Reader` class responsible for reading the files.
- `java/com/engflow/varyinginputs/writer`: Contains the `Writer` class responsible for writing the files.

## Usage

To run the project and specify the number of files to be created, use the following command:

```sh
bazel run //java/com/engflow/internship/varyinginputs/main -- <num_files>
bazel run //java/com/engflow/varyinginputs/main -- <num_files>
```

Replace `<num_files>` with the desired number of files to be created.
Expand All @@ -26,7 +26,7 @@ Replace `<num_files>` with the desired number of files to be created.
To create and read 10 files, you would run:

```sh
bazel run //java/com/engflow/internship/varyinginputs/main -- 10
bazel run //java/com/engflow/varyinginputs/main -- 10
```

This command will:
Expand Down
2 changes: 1 addition & 1 deletion java/com/engflow/varyinginputs/main/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ java_binary(
data = [
"//java/com/engflow/varyinginputs/input:input",
],
main_class = "com.engflow.internship.varyinginputs.main.Main",
main_class = "com.engflow.varyinginputs.main.Main",
)
2 changes: 1 addition & 1 deletion java/com/engflow/varyinginputs/reader/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ java_library(
java_test(
name = "reader_test",
srcs = ["ReaderTest.java"],
test_class = "com.engflow.internship.varyinginputs.reader.ReaderTest",
test_class = "com.engflow.varyinginputs.reader.ReaderTest",
deps = [
":reader",
],
Expand Down
2 changes: 1 addition & 1 deletion java/com/engflow/varyinginputs/writer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ java_library(
java_test(
name = "writer_test",
srcs = ["WriterTest.java"],
test_class = "com.engflow.internship.varyinginputs.writer.WriterTest",
test_class = "com.engflow.varyinginputs.writer.WriterTest",
deps = [
":writer",
],
Expand Down

0 comments on commit 1f4c666

Please sign in to comment.