flogger icon indicating copy to clipboard operation
flogger copied to clipboard

Add build instructions

Open fbricon opened this issue 7 years ago • 8 comments

Bazel being less ubiquitous than Maven and Gradle, it'd be nice if there were some build instructions in the CONTRIBUTING.md page

fbricon avatar Apr 19 '18 14:04 fbricon

Just to clarify: are you asking about how to build locally to develop features inside Flogger?

ronshapiro avatar Apr 20 '18 19:04 ronshapiro

+1

I have attempted to fork the project to make a change and am having a lot of trouble getting it to import into IntelliJ IDEA and/or build.

Running bazel build at the root doesn't seem to do much.

jfnavin avatar May 10 '18 06:05 jfnavin

Running bazel build at the root doesn't seem to do much.

I'm not following. bazel build does a lot here:

  $ bazel build //...
  [...]
  $ bazel test //...
  INFO: Analysed 51 targets (0 packages loaded).
INFO: Found 24 targets and 27 test targets...
INFO: Elapsed time: 3.462s, Critical Path: 1.53s
INFO: 27 processes, linux-sandbox.
INFO: Build completed successfully, 28 total actions
//api:src/test/java/com/google/common/flogger/FluentLoggerTest           PASSED in 0.7s
//api:src/test/java/com/google/common/flogger/LogContextTest             PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/LogSiteStackTraceTest      PASSED in 0.4s
//api:src/test/java/com/google/common/flogger/LogSiteStatsTest           PASSED in 0.4s
//api:src/test/java/com/google/common/flogger/LoggerConfigTest           PASSED in 0.4s
//api:src/test/java/com/google/common/flogger/MetadataKeyTest            PASSED in 0.7s
//api:src/test/java/com/google/common/flogger/backend/FormatCharTest     PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/backend/FormatOptionsTest  PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/backend/FormatTypeTest     PASSED in 1.0s
//api:src/test/java/com/google/common/flogger/backend/KeyValueFormatterTest PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/backend/SimpleMessageFormatterTest PASSED in 0.7s
//api:src/test/java/com/google/common/flogger/backend/TagsTest           PASSED in 1.0s
//api:src/test/java/com/google/common/flogger/backend/system/AbstractBackendTest PASSED in 0.7s
//api:src/test/java/com/google/common/flogger/backend/system/DefaultPlatformTest PASSED in 1.1s
//api:src/test/java/com/google/common/flogger/backend/system/SimpleBackendLoggerTest PASSED in 0.8s
//api:src/test/java/com/google/common/flogger/backend/system/SimpleLogRecordTest PASSED in 0.8s
//api:src/test/java/com/google/common/flogger/parameter/ParameterTest    PASSED in 0.6s
//api:src/test/java/com/google/common/flogger/parameter/SimpleParameterTest PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/parser/BraceStyleMessageParserTest PASSED in 0.8s
//api:src/test/java/com/google/common/flogger/parser/DefaultBraceStyleMessageParserTest PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/parser/DefaultPrintfMessageParserTest PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/parser/PrintfMessageParserTest PASSED in 0.9s
//api:src/test/java/com/google/common/flogger/util/CallerFinderTest      PASSED in 0.8s
//api:src/test/java/com/google/common/flogger/util/FastStackGetterTest   PASSED in 0.7s
//api:src/test/java/com/google/common/flogger/util/StackBasedLogSiteTest PASSED in 0.8s
//google:src/test/java/com/google/common/flogger/GoogleLoggerTest        PASSED in 0.9s
//google:src/test/java/com/google/common/flogger/PackageSanityTest       PASSED in 1.4s

Particularly, I'm seeing now these artifacts: bazel-bin/api/libapi.jar`:

  $ bazel build api:api
INFO: Analysed target //api:api (0 packages loaded).
INFO: Found 1 target...
Target //api:api up-to-date:
  bazel-bin/api/libapi.jar
INFO: Elapsed time: 0.179s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action

and: bazel-bin/api/libsystem_backend.jar:

$ bazel build api:system_backend
INFO: Analysed target //api:system_backend (0 packages loaded).
INFO: Found 1 target...
Target //api:system_backend up-to-date:
  bazel-bin/api/libsystem_backend.jar
INFO: Elapsed time: 0.154s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action

My Bazel version used: 0.13.0, on Linux.

davido avatar May 10 '18 07:05 davido

Bazel being less ubiquitous than Maven and Gradle, it'd be nice if there were some build instructions in the CONTRIBUTING.md page

Every Bazel build instructions are three liners:

  • Install Bazel
  • Run build bazel build //...
  • Run tests bazel test //...

davido avatar May 10 '18 07:05 davido

Cheers - I missed the ... (which turns out to be important :) )

jfnavin avatar May 10 '18 08:05 jfnavin

Fwiw: https://groups.google.com/d/topic/flogger-discuss/cFpgiv4BPC4/discussion

tbroyer avatar Jun 05 '18 09:06 tbroyer

Maybe use gradle as first-class build system, and add task to generate basel config from it?

IRus avatar May 03 '19 18:05 IRus

@ronshapiro I added this issue to build flogger on Bazel CI to avoid unnoticed breakages like the one you fixed in: [1].

[1] https://github.com/google/bazel-common/issues/37

davido avatar May 06 '19 07:05 davido