blob: 87c579b69c27b480437dad03095bc928db02cae8 [file] [log] [blame]
genrule(
name = 'resource',
srcs = [
'LameGenfile.java',
'resource.base.txt',
],
bash = ('TEXT=`cat resource.base.txt`;' +
'sed \"s/REPLACEME/$TEXT/g\" LameGenfile.java > $OUT'),
cmd_exe = 'powershell.exe -Command "Get-Content LameGenfile.java | ' +
'%{$_ -replace \'REPLACEME\', (Get-Content resource.base.txt)} | ' +
'Out-File -Encoding ASCII $env:OUT"',
out = 'LameGenfile.java',
)
java_library(
name = 'library',
srcs = [
':resource',
],
)
java_test(
name = 'test',
srcs = [
'LameTest.java',
],
deps = [
':junit',
':library',
],
)
prebuilt_jar(
name = 'junit',
binary_jar = 'junit-4.11.jar',
deps = [
':hamcrest-core',
':hamcrest-library',
],
)
prebuilt_jar(
name = 'hamcrest-core',
binary_jar = 'hamcrest-core-1.3.jar',
)
prebuilt_jar(
name = 'hamcrest-library',
binary_jar = 'hamcrest-library-1.3.jar',
)