aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/singlejar
Commit message (Collapse)AuthorAge
* [singlejar] Port mapped_file for WindowsGravatar Loo Rong Jie2018-08-08
| | | | | | | | | | `src/tools/singlejar/mapped_file_*.inc` are now included in `src/tools/singlejar/mapped_file.cc` instead of header file and no longer inline most member functions: these functions are too large for inlining. /cc @laszlocsomor Closes #5780. PiperOrigin-RevId: 207998444
* [singlejar] Remove redundant test_util depsGravatar Loo Rong Jie2018-08-07
| | | | | | | | | | Side-note: `options_test`, `zip_headers_test` and `zlib_interface_test` now pass on Windows. /cc @laszlocsomor Closes #5781. PiperOrigin-RevId: 207699280
* [singlejar] Set binary flag for WindowsGravatar Loo Rong Jie2018-08-07
| | | | | | | | /cc @laszlocsomor Closes #5779. PiperOrigin-RevId: 207693540
* Automatic code cleanup.Gravatar Googler2018-08-01
| | | | PiperOrigin-RevId: 206960449
* [singlejar] cleanup port libraryGravatar Loo Rong Jie2018-07-27
| | | | | | | | /cc @laszlocsomor Closes #5655. PiperOrigin-RevId: 206319221
* Windows,tests: port singlejar bash testsGravatar Loo Rong Jie2018-07-23
| | | | | | | | | | Make these tests run on Windows, but currently does not pass. /cc @laszlocsomor Closes #5652. PiperOrigin-RevId: 205658932
* [singlejar] Change off_t and ssize_t to C standard ptrdiff_tGravatar Loo Rong Jie2018-07-18
| | | | | | | | | | | | | | MSVC does not have `ssize_t` type. MSVC does have `off_t`, but is defined as 32-bit `long` due to legacy reason, this will prevent us from handling large file. Changing `off_t` and `ssize_t` to C standard `ptrdiff_t` for portability and consistency. Changing one instance of `S_ISDIR(st.st_mode)` to `(st.st_mode & S_IFDIR) == S_IFDIR` as MSVC does not have `S_ISDIR` macro. /cc @laszlocsomor Closes #5538. PiperOrigin-RevId: 205038203
* [singlejar] Add port library for various MSVC hacksGravatar Loo Rong Jie2018-07-17
| | | | | | | | | | | | A small `port` library with various MSVC hacks. This is needed for future PRs. For non-Windows platforms, `port.cc` will produce an empty object file. #2241 /cc @laszlocsomor Closes #5501. PiperOrigin-RevId: 204889516
* [singlejar] Various portability fixes for MSVCGravatar Loo Rong Jie2018-07-10
| | | | | | | | | | | | | | | - MSVC does not have `errx` functions, so use `diag_errx` etc. instead. - Fix format when trying to print `size_t`, use `%zu` so that the function will handle 32/64-bit `size_t` according to target system automatically. - Adding/guarding a few includes for MSVC. - MSVC does not have `ssize_t`, so replace it with `ptrdiff_t` #2241 /cc @laszlocsomor Closes #5499. PiperOrigin-RevId: 204074420
* [singlejar] Replace setbuffer with setvbufGravatar Loo Rong Jie2018-07-03
| | | | | | | | | | | | `setbuffer` is not available on MSVC, use C-standard `setvbuf` from `stdio.h` instead. `setbuffer` was introduced in https://github.com/bazelbuild/bazel/commit/b4cf5e32a94024c1bfdc6ca432677c31306a3fb5. #2241 /cc @laszlocsomor Closes #5500. PiperOrigin-RevId: 203083781
* Enable android dependency checking in Bazel.Gravatar xingao2018-06-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 202644613
* Replace //tools/defaults:jdk to //tools/jdk:*Gravatar dbabkin2018-06-26
| | | | | | | As //tools/defaults will be deprecated soon. All usages of //tools/defaults:jdk and //tools/defaults:java_toolchain should be replaced by corresponding targets in //tools/jdk/BUILD package RELNOTES:none PiperOrigin-RevId: 202114489
* Remove usage of COMPILER_MSVC in Bazel and ijarGravatar Loo Rong Jie2018-06-11
| | | | | | | | | | | | | Convert most `COMPILER_MSVC` to `_WIN32` (as they apply to Windows platform, not MSVC compiler). Only `src/tools/singlejar/zip_headers.h` and `src/main/cpp/util/md5.h` actually need `_MSC_VER`. `COMPILER_MSVC` in `third_party/protobuf` are not removed. They can be fixed by updating dependency to newer version. /cc @meteorcloudy Closes #5350. Change-Id: Ibc131abfaf34a0cb2bd338549983ea9d28eaabfe PiperOrigin-RevId: 200019793
* Move path-manipulation functions to own library file.Gravatar ccalvarin2018-06-05
| | | | | | | | | | | Leave functions that make file accesses in the file library, and general blaze utilities in the blaze_util file, but move the functions that boil down to string manipulation and path formatting to their own file. (With the exception of getCWD, since absolute path syntax is relevant here.) Doing this largely to consolidate all Windows path control into a single place, so that it's easier to notice inconsistencies. For instance, ConvertPath currently makes Windows paths absolute, but not Posix paths, and MakeAbsolute relies on this behavior. In addition, JoinPath assumes Posix path syntax, which leads to some odd looking paths. These will be fixed in a followup change. (Found these issues while working on #4502, trying to fix the windows-specific system bazelrc.) RELNOTES: None. PiperOrigin-RevId: 199368226
* add singlejar variant to bazel that includes Android desugar dependency checkingGravatar kmb2018-03-29
| | | | PiperOrigin-RevId: 190999682
* Fix unused variable warnings from clang.Gravatar Austin Schuh2018-03-28
| | | | | | | | This was preventing ijar and singlejar from building when included in @bazel_tools in our repo. Change-Id: I1553e4f3615965cb997579e7d277fb2a08f9b91b PiperOrigin-RevId: 190840090
* In singlejar runs with --check_desugar_deps, error out when encountering ↵Gravatar kmb2018-03-27
| | | | | | | | j$.** files. RELNOTES: None. PiperOrigin-RevId: 190667956
* Add dependency on googletest, so we can use gmock along with gtest.Gravatar ccalvarin2018-03-23
| | | | | | | third_party/gtest can go away after this. RELNOTES: None. PiperOrigin-RevId: 190221581
* Internal changeGravatar Laszlo Csomor2018-03-09
| | | | PiperOrigin-RevId: 188459395
* windows,singlejar: compile "token_stream"Gravatar Laszlo Csomor2018-02-14
| | | | | | | | | | We can now compile //src/tools/singlejar:token_stream on Windows. See https://github.com/bazelbuild/bazel/issues/2241 Change-Id: I98f86e608e5ebaf685e4de26b2dabe75fcca78d2 PiperOrigin-RevId: 185655986
* Bug fix: a call to OutputJar::ReserveCdh potentially invalidates the addressesGravatar asmundak2018-01-17
| | | | | | | | returned by the previous calls of the same method. Keep each such address in a separate scope. RELNOTES: Crash in OutputJar::Close has been fixed PiperOrigin-RevId: 182286718
* Clean up Windows config_settingsGravatar Yun Peng2018-01-12
| | | | | | | | | | | | | | 1.Deleted config_setting for --cpu=x64_windows_msys, because we don't build Bazel with MSYS gcc anymore. 2.Deleted config_setting for --cpu=x64_windows_msvc, because it uses exactly the same toolchain as --cpu=x64_windows, it'll be removed in the future. This change reduces the complexity of our BUILD files and make them less confusing. Change-Id: I939831a6861413b0f745fb1be98aacd4fb780e0a PiperOrigin-RevId: 181751853
* Concatenate reference config files in singlejarGravatar Tony Liang2018-01-11
| | | | | | | | | | | Merge reference.conf files in single jar since [akka will break](https://doc.akka.io/docs/akka/current/general/configuration.html#when-using-jarjar-onejar-assembly-or-any-jar-bundler) if reference.conf files are overwritten. The feature is added to both java and cpp implementations of singlejar to concatenate reference.conf files to keep behaviors consistent. For the cpp implementation, using `OutputJar.ExtraCombiner` in singlejar_main.cc feels less intrusive than adding a new `Concatenator` in the output_jar code. Bazel-dev discussion on the issue is [here](https://groups.google.com/forum/#!topic/bazel-dev/C30dwAPL708). Closes #4413. PiperOrigin-RevId: 181622277
* Move bazel conditions into src/conditions.Gravatar tomlu2017-11-30
| | | | | | | This will enable an easier transition from checked-in BUILD files to ones generated by copybara. RELNOTES: None PiperOrigin-RevId: 177514519
* Adjust the singlejar binary to accept an optional comma-separated "label" withGravatar Googler2017-10-27
| | | | | | | each entry in the --outputs flag. RELNOTES: n/a PiperOrigin-RevId: 173547248
* Exclude Android dependency checking from Bazel's singlejar build.Gravatar kmb2017-10-23
| | | | | | | This should also address https://github.com/bazelbuild/bazel/issues/3903 RELNOTES: None. PiperOrigin-RevId: 172963663
* add option to singlejar to double-check correct default and static interface ↵Gravatar kmb2017-10-12
| | | | | | | | method desugaring for Android. RELNOTES: none PiperOrigin-RevId: 171891682
* Internal changeGravatar Googler2017-08-07
| | | | PiperOrigin-RevId: 164436730
* Include <cinttypes> instead of <stdint.h>Gravatar Damien Martin-Guillerez2017-07-27
| | | | | | | | | | | cinttypes is the C++ header that should replace stdint.h. Not using the correct header was leading to compilation error on CentOS 6.7 Fixes #3455. To be cherry-picked for #3375. Change-Id: I6df22134a4a4902ec9fa7ecdfaeb5408eacf3564 PiperOrigin-RevId: 163334651
* fix singlejar signedness problemsGravatar Benjamin Peterson2017-07-05
| | | | | | | | | | | | while (total_written < count) { ~~~~~~~~~~~~~~^~~~~~~ Most of these can be fixed by simply by storing the return value of various functions in the right variable type. E.g., cen_offset32 can naturally be stored in uin32_t rather than uint64_t. Change-Id: I9f188ca541e4fe2587c636670807f56887e1655e PiperOrigin-RevId: 160897953
* Make source code of singlejar and ijar available from @bazel_tools. ,Gravatar Xin Gao2017-06-22
| | | | | | | | | | Please refer to patch set 9 and its CI run for usage and test results. In practice, users should create their own java_toolchain rule in their project's BUILD file, and set the two attributes like above instead of modifying //tools/jdk/BUILD. Change-Id: Ic880f243086b00a58d453a8139ba4c957fe54bc7 PiperOrigin-RevId: 159694649
* Make singlejar aware of FreeBSDGravatar Klaus Aehlig2017-06-09
| | | | | | | | | | | | | The C implementation of singlejar verifies that it is built for a supported system; currently those are 64-bit linux and apple systems. However, the code is portable enough that it can easily be adapted to run on 64-bit FreeBSD systems as well. In fact, only the path of a single header file is different, and we need to link with -lm. Fixes #3096. Change-Id: Id69542ad940f1161aceb55eb8f5dabda2f486747 PiperOrigin-RevId: 158533955
* Define __STDC_FORMAT_MACROS to 1 in singlejarGravatar Damien Martin-Guillerez2017-05-08
| | | | | | | Build on CentOS was failing because of missing macros, see http://ci.bazel.io/job/bazel-docker-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=docker/557/console. Change-Id: I1b7b2ef2b1f26d4dac5439f4fcd01e2ef6553dcf PiperOrigin-RevId: 155365288
* Make singlejar's flag.xml merging idempotentGravatar cushon2017-04-25
| | | | | | | | Previously running singlejar over the same flags.xml multiple times would add start/end tags each time, resulting in repeated top-level tags. PiperOrigin-RevId: 154126431
* Support directories in --resourcesGravatar cushon2017-04-24
| | | | PiperOrigin-RevId: 153787279
* Create parent directories for resourcesGravatar cushon2017-04-04
| | | | | | | | | This makes singlejar's handling of resources consistent with JavaBuilder, and allows the JavaBuilder resource handling to be replaced by a singlejar action that adds resources to library jars separately from compilation (see unknown commit). PiperOrigin-RevId: 152082884
* Singlejar: Windows-aware jar tool pathGravatar Laszlo Csomor2017-03-09
| | | | | | | | See https://github.com/bazelbuild/bazel/issues/2107 -- PiperOrigin-RevId: 149626394 MOS_MIGRATED_REVID=149626394
* Bazel client: simplify {Read,Write}File semanticsGravatar Laszlo Csomor2017-03-01
| | | | | | | | | | | | | | | | Introduce a platform-specific file handle type (HANDLE on Windows, int on Linux/Darwin/FreeBSD) so we can get rid of the read_func and write_func functions, since they are always the same everywhere. Also include file_platform.h in file.h, since they are logically the same file (file_platform.h is just the platform-specific part of file.h). -- PiperOrigin-RevId: 148892736 MOS_MIGRATED_REVID=148892736
* Avoid using //external labels; use @local_jdk// insteadGravatar Ulf Adams2017-02-14
| | | | | | -- PiperOrigin-RevId: 147449557 MOS_MIGRATED_REVID=147449557
* Handle huge (>4GB) output jars.Gravatar Sasha Smundak2017-01-04
| | | | | | | | RELNOTES: singlejar can now create jar files larger than 4GB. -- PiperOrigin-RevId: 143588105 MOS_MIGRATED_REVID=143588105
* Power supportGravatar Nishidha Panpaliya2016-12-21
| | | | | | | | | Closes #2139. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2139 PiperOrigin-RevId: 142570236 MOS_MIGRATED_REVID=142570236
* move MakeDirectories() into file_platform.hGravatar Thiago Farina2016-12-07
| | | | | | | | | | | | | | This way we can remove the dependency on blaze_util (which is Bazel's client specific) from singlejar. This work was made possible by commit 49970e0136d0: ("Bazel client: platform-specific {Read,Write}File"). -- Change-Id: I6e95fb9119a271e4d48cbe2eefc1d5354ee188aa Reviewed-on: https://cr.bazel.build/7650 PiperOrigin-RevId: 141294165 MOS_MIGRATED_REVID=141294165
* Make token_stream a cc_libraryGravatar Liam Miller-Cushon2016-12-06
| | | | | | -- PiperOrigin-RevId: 141145286 MOS_MIGRATED_REVID=141145286
* Fix typos in usage exampleGravatar Liam Miller-Cushon2016-12-06
| | | | | | -- PiperOrigin-RevId: 141116980 MOS_MIGRATED_REVID=141116980
* Added tests for exportGravatar Kristina Chodorow2016-11-29
| | | | | -- MOS_MIGRATED_REVID=140380336
* Bazel client: platform-specific {Read,Write}FileGravatar Laszlo Csomor2016-11-28
| | | | | | | | | | | | | | | | Move blaze::ReadFile and blaze::WriteFile to file.h and file_platform.h (thus into the blaze_util namespace), and update references. This allows us to implement these methods in a platform-specific way. Also move UnlinkPath. See https://github.com/bazelbuild/bazel/issues/2107 -- MOS_MIGRATED_REVID=140328273
* Bazel client: reduce dependency on POSIX APIGravatar Laszlo Csomor2016-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can now compile blaze_util_windows.cc with MSVC, yay! (when building //src:bazel --cpu=x64_windows_msvc -k). There are a lot of #ifdef's and TODOs so this is a modest victory for now. In this change: - change blaze::MakeDirectories to return bool instead of int, since that's how it was used anyway, and to expect the permission mask as unsigned int instead of mode_t, since the former is good enough and compatible with mode_t on POSIX while mode_t is not defined on Windows - move blaze::MakeDirectories into blaze_util_<platform> - implement envvar-handling in blaze_util_<platform> and use it everywhere See https://github.com/bazelbuild/bazel/issues/2107 -- MOS_MIGRATED_REVID=139887503
* Cut the dependency of singlejar on Bazel (the test still depend on it, but ↵Gravatar Lukacs Berki2016-11-21
| | | | | | | that's OK) -- MOS_MIGRATED_REVID=139774407
* Implement --nocompress_suffixes option.Gravatar Sasha Smundak2016-09-26
| | | | | | | The planned replacement of the ApkBuilder with singlejar uses it. -- MOS_MIGRATED_REVID=134290339
* Add '0xCAFE' extra field to the first entry of the output jar (which is ↵Gravatar Sasha Smundak2016-09-26
| | | | | | | META-INF/). Unix 'file' utility uses it to distinguish jar file from zip file. -- MOS_MIGRATED_REVID=134102453