Commit graph

3866 commits

Author SHA1 Message Date
Colin Cross
38f794ee49 Refactor proto in preparation for java proto support
Test: m -j checkbuild
Change-Id: Idf00ea0bacb2777458f9af2c7eb47e1e1854eeba
2017-09-11 12:41:58 -07:00
Treehugger Robot
ffe58feb76 Merge changes from topic "soong_mdnsresponder"
* changes:
  Add windows libraries used by mdnsresponder
  Add support for Windows Message Compiler
2017-09-09 23:31:29 +00:00
Dan Willemsen
b18cf7a5a0 Add windows libraries used by mdnsresponder
Test: Check for presence in prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8
Change-Id: Iaa0b56ca8ff94ebcd925238f211d9bd5d52a4a0c
2017-09-09 13:06:25 -07:00
Dan Willemsen
4f1c3d4116 Add support for Windows Message Compiler
We've only got one user of this currently, but since it needs the
location of the toolchain, and different flags based on 32 vs 64-bit,
it's easier just to add support than to get this into a genrule.

Test: Convert external/mdnsresponder to Soong, build
Change-Id: I6c19a82bc14f6ab556f6cc5f37164862ba5f9083
2017-09-09 13:06:25 -07:00
Colin Cross
018f4a0d08 Merge changes Ifbf9fe27,I41a6cd42,Ieae59efb
* changes:
  Allow some duplicates in merged jars
  Add support for java annotation processors
  Update java androidmk conversions
2017-09-09 05:18:44 +00:00
Treehugger Robot
ace7a6ba43 Merge "Make -ldl -lrt -lpthread implicit for host builds" 2017-09-09 01:32:23 +00:00
Treehugger Robot
c6cf722ff3 Merge "Move benchmarks to /data/benchmarktest[64] to match make" 2017-09-09 01:22:10 +00:00
Colin Cross
fc05eacb13 Merge "Use same module name for java binary wrapper and jar" 2017-09-09 00:47:08 +00:00
Treehugger Robot
b767fbc986 Merge "Remove (TARGET|HOST)_BUILD_TYPE path modifications" 2017-09-08 23:40:35 +00:00
Colin Cross
c5fdbb842a Make -ldl -lrt -lpthread implicit for host builds
Instead of requiring every host module to specify -ldl -lrt -lpthread
and then break the mac build because -lrt doesn't exist, make them
implicit to match the behavior of modules built for the device.

Test: m -j checkbuild
Change-Id: I63c26adef71e71d314b9c9caa31c1aeb1d8f6651
2017-09-08 16:39:05 -07:00
Colin Cross
28690e9c74 Move benchmarks to /data/benchmarktest[64] to match make
Port Ife0f43062e36ffc856f41683ddc4d91a7787333e to soong.

Test: m -j checkbuild
Change-Id: I66a0a53061b547e30aedd16ee617723197069171
2017-09-08 16:32:16 -07:00
Dan Willemsen
4dc4e14d15 Remove (TARGET|HOST)_BUILD_TYPE path modifications
They don't really affect anything general in android except for the
output path.

Bug: 65453318
Test: TARGET_BUILD_TYPE=debug m
Change-Id: I98c17fefae61f9f7936e184bd1f8441086bb7d23
2017-09-08 21:47:31 +00:00
Pirama Arumuga Nainar
e4f042c682 Add toolchain/* to root.bp
Soong will now scan toolchain/benchmark for any blueprint files.

Test: Cherry-pick
https://android-review.googlesource.com/#/c/toolchain/benchmark/+/474805/,
that has blueprint files in toolchain/benchmark and build.

Change-Id: Ia4ef262094d60423f80f195ea0b95392b740f476
2017-09-08 12:46:34 -07:00
Colin Cross
1965568eee Use same module name for java binary wrapper and jar
Trying to use dx.jar for the jar module name and dx for the
wrapper module name leads to the make side installing dx.jar.jar.
The separate names are only needed to make LOCAL_REQUIRED_MODULES
work.  Make the names the same again, and use a manual dependency
from the installed location of the wrapper script to the installed
location of the jar to make sure that both get installed and that
the wrapper script timestamp is always as new as the jar.

Test: m -j checkbuild
Change-Id: Ibc8ce9d24ed770e9a270fb8eaa8fe1b427a382a7
2017-09-07 17:00:22 -07:00
Colin Cross
5349941875 Use soong_java_prebuilt.mk to export soong jars to java
Instead of trying to squeeze soong jars through prebuilt_internal.mk,
make a separate soong_java_prebuilt.mk.

Test: m -j checkbuild
Change-Id: Idadef3c21a6f618d573110f04c80d7db3db92031
2017-09-07 20:23:43 +00:00
Colin Cross
34540315a0 Allow some duplicates in merged jars
Only take the first MANIFEST.MF or module-info.class file.

Test: m -j checkbuild
Change-Id: Ifbf9fe272437ef2c2bd51ab4849ac8d7ef37b6fc
2017-09-06 15:01:07 -07:00
Colin Cross
32f676a7b4 Add support for java annotation processors
Add annotation_processor and annotation_processor_classes properties.

Test: m -j checkbuild
Change-Id: I41a6cd42f0c048070a99cb18af150030170498f7
2017-09-06 13:44:03 -07:00
Colin Cross
6c51d80adb Update java androidmk conversions
Java prebuilts are now java_import, and add support for java_version
properties.

Test: m -j checkbuild
Change-Id: Ieae59efb3370f1370f82fc3672facbbb98205c68
2017-09-06 13:44:03 -07:00
Colin Cross
0a6e007e06 Make javac rules output a jar with soong_zip
Make javac rules output a jar file instead of a classes.list.
Combine the output jar, static jar dependencies, and resources
into the final jar using a separate rule.  For now, use a shell
command with unzip and soong_zip to create the final jar,
eventually it will be done with a zip2zip-style jar combiner.

Bug: 64691570
Test: java_test.go
Change-Id: Id8e6313e0097b78947d88e86e47b56ad08caca1a
2017-09-05 22:08:13 -07:00
Colin Cross
fee57cb33e Move error_prone config to external/error_prone
The error_prone config will likely need to be updated at the same
time as the error_prone prebuilts, so move the config into the same
project.  This requires jumping through some hoops because
external/error_prone may not be present in all manifests.

Bug: 64489631
Test: m -j RUN_ERROR_PRONE=true
Change-Id: I2c59df1148134ffedac0e00d32ac7082a9fb5330
2017-09-05 22:08:13 -07:00
Colin Cross
32616ed3e0 Ignore environment variables in tests
The next change will cause java tests to fail if RUN_ERROR_PRONE=true
is set.  Make tests more hermetic by faking an empty environment.

Test: soong tests
Change-Id: I01057cb0c42ec08ebed8aea87505dd01e9981915
2017-09-05 22:08:13 -07:00
Treehugger Robot
807dcc9617 Merge changes from topic "hermetic"
* changes:
  Add support for python_defaults modules
  <Hermetic> Replace Soong Python bootstrap process with embedded launcher.
2017-09-06 02:59:27 +00:00
Treehugger Robot
afd0f7d4e7 Merge "Fix path to notice file" 2017-09-06 01:24:34 +00:00
Treehugger Robot
30402aab09 Merge "Add tools/* to subdirs for Android.bp search" 2017-09-06 00:40:38 +00:00
Nan Zhang
a3fc4ba733 Add support for python_defaults modules
Test: python_test.go
Change-Id: I2077414a5b06da5e660a1b48bfdb2eb926fb702f
2017-09-05 17:31:24 -07:00
Nan Zhang
d4e641b6e9 <Hermetic> Replace Soong Python bootstrap process with embedded
launcher.

For Python2, we bundle embedded launcher as bootstrapper within every
.par file. This feature is only enabled for linux_x86_64 for now. We
provide a user flag: hermetic_enabled within bp file. By default, Pyhon2
still use classic bootstrapping way to construct .par file and relys on
host interpreter. Once embedded_launcher is enabled, launcher will be
used to bootstrap .par file and execute user program.

For Python3, the launcher will be ready soon, and for now it still relys
on classic bootstrapping.

Test: Real example is used to test.

Bug: b/63018041

Change-Id: I28deba413d8ad3af407595e46f77d663e79a3705
2017-09-05 17:26:57 -07:00
Colin Cross
aa76858e48 Fix path to notice file
Make expects notice files paths to be from the root of the tree.

Test: m -j checkbuild
Change-Id: Ic280a8a97797b9a088aeb4e4a52b79816d2d4197
2017-09-05 15:55:04 -07:00
Treehugger Robot
612e27d545 Merge changes I825ec897,I565a5624
* changes:
  Support non-installable java libraries
  Add notice property to all modules
2017-09-05 22:31:33 +00:00
Colin Cross
2c429dc7d4 Support non-installable java libraries
Some java libraries will never be installed, support an
installable: false property and export it back to make as
LOCAL_UNINSTALLABLE_MODULE := true.

Test: m -j checkbuild, manually inspect out/soong/Android*.mk
Change-Id: I825ec897648c82fb7323da7df3539c9aaa6bcfce
2017-09-05 13:48:23 -07:00
Treehugger Robot
ff2abe56da Merge "Implement merge_zips" 2017-09-01 22:54:41 +00:00
Alex Light
b8bee63fa2 Add tools/* to subdirs for Android.bp search
This is needed to build the tools/dexter project.

Test: cd tools/dexter; mma -j50
Bug: 65011851
Change-Id: I7ca85cf5d9133b99e547ee2c9631bd0f9ebb4784
2017-09-01 22:30:01 +00:00
Treehugger Robot
5ade8a859d Merge changes I7b6c6ce0,If0eaf5d5
* changes:
  Allow java modules to use filegroups
  Rename no_standard_libraries to no_standard_libs
2017-09-01 22:21:25 +00:00
Jeff Gaston
8bab5f2015 Implement merge_zips
For merging .zip and/or .jar files

Bug: 64691570
Test: merge_zips merged.zip in1.zip in2.zip
Change-Id: I9a080d25b92a506c9b5451670c4786895b2722ab
2017-09-01 13:52:13 -07:00
Colin Cross
5aac362949 Add notice property to all modules
Add a notice property to all modules which, if set, propagates to
LOCAL_NOTICE_FILE in make.

Test: m -j checkbuild, examine out/soong/Android*.mk
Change-Id: I565a5624dfd7b376b976b1a43dac5cea96869026
2017-09-01 13:21:53 -07:00
Treehugger Robot
b0579d70b8 Merge "Add core-oj to bootclasspath" 2017-09-01 19:55:53 +00:00
Colin Cross
379877d794 Merge changes I5fae03f4,Id41ad4ea
* changes:
  Pass --min-sdk-version to dx
  Make binaries executable
2017-09-01 19:50:39 +00:00
Tobias Thierer
0bf1f85c48 Merge "Export JLINK and JMOD commands from soong." 2017-09-01 08:37:58 +00:00
Nan Zhang
40962998a2 Add external/python/* in root.bp
Bug: b/38395161
Test: mma under external/python/cpython2

Change-Id: I95fde837025022bf0f6b65246ab0a35a0b41972c
2017-08-31 15:41:47 -07:00
Colin Cross
7f9036c89b Allow java modules to use filegroups
Using filegroups requires calling ExtractSourcesDeps from the deps
mutator.

Test: m -j checkbuild
Change-Id: I7b6c6ce0075e4a703d28085a3965f11d9bb46315
2017-08-31 13:48:52 -07:00
Colin Cross
227d436943 Add core-oj to bootclasspath
Also clear the bootclasspath for device builds so javac doesn't
fall back to the default rt.jar bootclasspath.

Test: java_test.go
Change-Id: Ia21f55c7d45db560e2f44be81b2f46587d9026f2
2017-08-31 13:48:52 -07:00
Colin Cross
595a406f88 Pass --min-sdk-version to dx
Pass the sdk_version property, the platform sdk version, or 10000
to dx as --min-sdk-version.

Test: m -j checkbuild
Change-Id: I5fae03f44153dc2d6244c33f4c055e746980aefe
2017-08-31 13:48:52 -07:00
Colin Cross
76b5f0ca31 Rename no_standard_libraries to no_standard_libs
For consistency with libs and static_libs.  And make it a *bool
so that it can be overriden when used in java_defaults modules.

Test: java_test.go
Change-Id: If0eaf5d5571dc6e565056d273b0addd960d6b33f
2017-08-31 13:48:52 -07:00
Colin Cross
5c51792926 Make binaries executable
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file.  Also remove InstallFile and rename
InstallFileName to InstallFile.

Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
2017-08-31 13:48:52 -07:00
Colin Cross
add7fdf1a5 Merge changes Iac19fbd3,Id4707189
* changes:
  Improve soong_zip filename collisions
  Add soong_zip -D to zip whole directories
2017-08-31 20:29:27 +00:00
Tobias Thierer
77d0b41d2e Export JLINK and JMOD commands from soong.
jlink and jmod are new commands added in OpenJDK 9.
The new commands are exported only when the environment
variable EXPERIMENTAL_USE_OPENJDK9 is set to true.

Control of toolchain commands moved to soong in commit
2aad9c2882

Bug: 38177569
Test: Treehugger

Change-Id: I52d81b95357162e31a2017080b27ef076a470b14
2017-08-31 16:15:06 +01:00
Colin Cross
e5580974c0 Improve soong_zip filename collisions
Allow filename collisions for directories, which may happen if
multiple globs of resources include the same directory names.
Continue to report errors if collisions occur between files, and
also add checks for collisions between files and directories.

Test: manual
Change-Id: Iac19fbd325c53fbb41552ea230d813c8dddf9439
2017-08-30 23:09:34 -07:00
Colin Cross
7b10cf14d2 Add soong_zip -D to zip whole directories
Combining the results of a javac command into a jar needs to take
a whole directory, add -D to specify a directory to search for all
files.

Test: m -j checkbuild
Change-Id: Id4707189d57b664f0262a0782630f893af397900
2017-08-30 23:09:34 -07:00
Dan Albert
6807ba2148 Fix ndk prebuilts script.
This wasn't actually including the quotes, so it was a no-op.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: http://b/65113115
Change-Id: I43fda02f58b9661fc78eef9055063347baaf84b3
2017-08-30 13:55:35 -07:00
Treehugger Robot
fe391875dc Merge "Export TARGET_JAVAC and HOST_JAVAC to make" 2017-08-30 18:26:58 +00:00
Treehugger Robot
25393ebcc4 Merge "Remove more duplicated flags and dependencies" 2017-08-29 22:38:57 +00:00