Move Eclipse related stuff into tools/eclipse
Try to reduce the size of the top-level BUCK file by moving anything that has to do with Eclipse project generation and classpath management into tools/eclipse. Change-Id: Id779eaff4fe732908b28a8e3441004e364b59e21
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
gerrit = //:gerrit
|
gerrit = //:gerrit
|
||||||
release = //:release
|
release = //:release
|
||||||
download = //:download
|
download = //:download
|
||||||
eclipse = //:eclipse
|
eclipse = //tools/eclipse:eclipse
|
||||||
|
eclipse_project = //tools/eclipse:eclipse_project
|
||||||
|
|
||||||
[buildfile]
|
[buildfile]
|
||||||
includes = //lib/DEFS
|
includes = //lib/DEFS
|
||||||
|
65
BUCK
65
BUCK
@@ -42,7 +42,8 @@ java_library(
|
|||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = 'download',
|
name = 'download',
|
||||||
cmd = 'buck build $(buck audit classpath --dot :eclipse_classpath' +
|
cmd = 'buck build ' +
|
||||||
|
'$(buck audit classpath --dot //tools/eclipse:classpath' +
|
||||||
'| egrep \'^ "//lib/\''+
|
'| egrep \'^ "//lib/\''+
|
||||||
'| cut -d\\" -f2' +
|
'| cut -d\\" -f2' +
|
||||||
'| sort | uniq)',
|
'| sort | uniq)',
|
||||||
@@ -50,65 +51,3 @@ genrule(
|
|||||||
deps = [],
|
deps = [],
|
||||||
out = '__fake.download__',
|
out = '__fake.download__',
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = 'eclipse',
|
|
||||||
cmd = '',
|
|
||||||
srcs = [],
|
|
||||||
deps = [
|
|
||||||
':_eclipse_project',
|
|
||||||
':_eclipse_classpath',
|
|
||||||
],
|
|
||||||
out = '__fake.eclipse__',
|
|
||||||
)
|
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = 'eclipse_project',
|
|
||||||
cmd = '',
|
|
||||||
srcs = [],
|
|
||||||
deps = [
|
|
||||||
':_eclipse_project',
|
|
||||||
':_eclipse_classpath_nocompile',
|
|
||||||
],
|
|
||||||
out = '__fake.eclipse__',
|
|
||||||
)
|
|
||||||
|
|
||||||
java_library(
|
|
||||||
name = 'eclipse_classpath',
|
|
||||||
deps = LIBS + PGMLIBS + [
|
|
||||||
'//gerrit-acceptance-tests:acceptance_tests',
|
|
||||||
'//gerrit-gwtdebug:gwtdebug',
|
|
||||||
'//gerrit-gwtui:ui_module',
|
|
||||||
'//gerrit-httpd:httpd_tests',
|
|
||||||
'//gerrit-main:main_lib',
|
|
||||||
'//gerrit-server:server__compile',
|
|
||||||
'//lib/prolog:compiler_lib',
|
|
||||||
] + scan_plugins(),
|
|
||||||
)
|
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = '_eclipse_project',
|
|
||||||
cmd = '${//tools:eclipse_project} $OUT',
|
|
||||||
srcs = [],
|
|
||||||
deps = ['//tools:eclipse_project'],
|
|
||||||
out = 'eclipse_project',
|
|
||||||
)
|
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = '_eclipse_classpath',
|
|
||||||
cmd = '${//tools:eclipse_classpath} $OUT $DEPS',
|
|
||||||
srcs = [],
|
|
||||||
deps = [
|
|
||||||
':eclipse_classpath',
|
|
||||||
'//tools:eclipse_classpath',
|
|
||||||
],
|
|
||||||
out = 'eclipse_classpath',
|
|
||||||
)
|
|
||||||
|
|
||||||
genrule(
|
|
||||||
name = '_eclipse_classpath_nocompile',
|
|
||||||
cmd = '${//tools:eclipse_classpath}',
|
|
||||||
srcs = [],
|
|
||||||
deps = ['//tools:eclipse_classpath'],
|
|
||||||
out = '__fake.eclipse__',
|
|
||||||
)
|
|
||||||
|
@@ -18,5 +18,5 @@ java_test(
|
|||||||
],
|
],
|
||||||
source_under_test = TEST,
|
source_under_test = TEST,
|
||||||
labels = ['slow'],
|
labels = ['slow'],
|
||||||
visibility = ['//:eclipse_classpath'],
|
visibility = ['//tools/eclipse:classpath'],
|
||||||
)
|
)
|
||||||
|
@@ -2,5 +2,5 @@ java_library(
|
|||||||
name = 'gwtdebug',
|
name = 'gwtdebug',
|
||||||
srcs = ['src/main/java/com/google/gerrit/gwtdebug/GerritDebugLauncher.java'],
|
srcs = ['src/main/java/com/google/gerrit/gwtdebug/GerritDebugLauncher.java'],
|
||||||
deps = ['//lib/gwt:dev'],
|
deps = ['//lib/gwt:dev'],
|
||||||
visibility = ['//:eclipse_classpath'],
|
visibility = ['//tools/eclipse:classpath'],
|
||||||
)
|
)
|
||||||
|
@@ -75,7 +75,7 @@ gwt_module(
|
|||||||
'//lib/gwt:user',
|
'//lib/gwt:user',
|
||||||
],
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
'//:eclipse_classpath',
|
'//tools/eclipse:classpath',
|
||||||
'//Documentation:licenses.txt',
|
'//Documentation:licenses.txt',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@@ -28,5 +28,5 @@ java_test(
|
|||||||
],
|
],
|
||||||
source_under_test = [':httpd'],
|
source_under_test = [':httpd'],
|
||||||
# TODO(sop) Remove after Buck supports Eclipse
|
# TODO(sop) Remove after Buck supports Eclipse
|
||||||
visibility = ['//:eclipse_classpath'],
|
visibility = ['//tools/eclipse:classpath'],
|
||||||
)
|
)
|
||||||
|
@@ -9,5 +9,5 @@ java_library(
|
|||||||
name = 'main_lib',
|
name = 'main_lib',
|
||||||
srcs = ['src/main/java/Main.java'],
|
srcs = ['src/main/java/Main.java'],
|
||||||
deps = ['//gerrit-launcher:launcher'],
|
deps = ['//gerrit-launcher:launcher'],
|
||||||
visibility = ['//:eclipse_classpath'],
|
visibility = ['//tools/eclipse:classpath'],
|
||||||
)
|
)
|
||||||
|
@@ -21,6 +21,7 @@ java_library2(
|
|||||||
visibility = [
|
visibility = [
|
||||||
'//:',
|
'//:',
|
||||||
'//gerrit-acceptance-tests:',
|
'//gerrit-acceptance-tests:',
|
||||||
|
'//tools/eclipse:classpath',
|
||||||
'//Documentation:licenses.txt',
|
'//Documentation:licenses.txt',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@@ -12,6 +12,7 @@ java_library(
|
|||||||
visibility = [
|
visibility = [
|
||||||
'//:',
|
'//:',
|
||||||
'//gerrit-gwtdebug:gwtdebug',
|
'//gerrit-gwtdebug:gwtdebug',
|
||||||
|
'//tools/eclipse:classpath',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,5 +36,8 @@ prebuilt_jar(
|
|||||||
name = 'log4j-config',
|
name = 'log4j-config',
|
||||||
binary_jar = genfile('log4j-config.jar'),
|
binary_jar = genfile('log4j-config.jar'),
|
||||||
deps = [':log4j-config__jar'],
|
deps = [':log4j-config__jar'],
|
||||||
visibility = ['//:'],
|
visibility = [
|
||||||
|
'//:',
|
||||||
|
'//tools/eclipse:classpath',
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
2
lib/DEFS
2
lib/DEFS
@@ -82,7 +82,7 @@ def java_library2(
|
|||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
resources = resources,
|
resources = resources,
|
||||||
deps = deps + compile_deps,
|
deps = deps + compile_deps,
|
||||||
visibility = ['//:eclipse_classpath'],
|
visibility = ['//tools/eclipse:classpath'],
|
||||||
)
|
)
|
||||||
# Break the dependency chain by passing the newly built
|
# Break the dependency chain by passing the newly built
|
||||||
# JAR to consumers through a prebuilt_jar().
|
# JAR to consumers through a prebuilt_jar().
|
||||||
|
@@ -19,5 +19,5 @@ java_library(
|
|||||||
name = 'compiler_lib',
|
name = 'compiler_lib',
|
||||||
srcs = ['java/BuckPrologCompiler.java'],
|
srcs = ['java/BuckPrologCompiler.java'],
|
||||||
deps = [':prolog-cafe'],
|
deps = [':prolog-cafe'],
|
||||||
visibility = ['//:eclipse_classpath'],
|
visibility = ['//tools/eclipse:classpath'],
|
||||||
)
|
)
|
||||||
|
12
tools/BUCK
12
tools/BUCK
@@ -9,15 +9,3 @@ python_binary(
|
|||||||
main = 'pack_war.py',
|
main = 'pack_war.py',
|
||||||
visibility = ['PUBLIC'],
|
visibility = ['PUBLIC'],
|
||||||
)
|
)
|
||||||
|
|
||||||
python_binary(
|
|
||||||
name = 'eclipse_classpath',
|
|
||||||
main = 'eclipse_classpath.py',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
||||||
|
|
||||||
python_binary(
|
|
||||||
name = 'eclipse_project',
|
|
||||||
main = 'eclipse_project.py',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
||||||
|
73
tools/eclipse/BUCK
Normal file
73
tools/eclipse/BUCK
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
include_defs('//tools/build.defs')
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = 'eclipse',
|
||||||
|
cmd = '',
|
||||||
|
srcs = [],
|
||||||
|
deps = [
|
||||||
|
':_classpath',
|
||||||
|
':_project',
|
||||||
|
],
|
||||||
|
out = '__fake.eclipse__',
|
||||||
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = 'eclipse_project',
|
||||||
|
cmd = '',
|
||||||
|
srcs = [],
|
||||||
|
deps = [
|
||||||
|
':_classpath_nocompile',
|
||||||
|
':_project',
|
||||||
|
],
|
||||||
|
out = '__fake.eclipse__',
|
||||||
|
)
|
||||||
|
|
||||||
|
java_library(
|
||||||
|
name = 'classpath',
|
||||||
|
deps = LIBS + PGMLIBS + [
|
||||||
|
'//gerrit-acceptance-tests:acceptance_tests',
|
||||||
|
'//gerrit-gwtdebug:gwtdebug',
|
||||||
|
'//gerrit-gwtui:ui_module',
|
||||||
|
'//gerrit-httpd:httpd_tests',
|
||||||
|
'//gerrit-main:main_lib',
|
||||||
|
'//gerrit-server:server__compile',
|
||||||
|
'//lib/prolog:compiler_lib',
|
||||||
|
] + scan_plugins(),
|
||||||
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = '_project',
|
||||||
|
cmd = '${:gen_project} $OUT',
|
||||||
|
srcs = [],
|
||||||
|
deps = [':gen_project'],
|
||||||
|
out = 'project',
|
||||||
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = '_classpath',
|
||||||
|
cmd = '${:gen_classpath} $OUT $DEPS',
|
||||||
|
srcs = [],
|
||||||
|
deps = [
|
||||||
|
':classpath',
|
||||||
|
':gen_classpath',
|
||||||
|
],
|
||||||
|
out = 'classpath',
|
||||||
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = '_classpath_nocompile',
|
||||||
|
cmd = '${:gen_classpath}',
|
||||||
|
srcs = [],
|
||||||
|
deps = [':gen_classpath'],
|
||||||
|
out = '__fake.eclipse__',
|
||||||
|
)
|
||||||
|
|
||||||
|
python_binary(
|
||||||
|
name = 'gen_classpath',
|
||||||
|
main = 'gen_classpath.py',
|
||||||
|
)
|
||||||
|
|
||||||
|
python_binary(
|
||||||
|
name = 'gen_project',
|
||||||
|
main = 'gen_project.py',
|
||||||
|
)
|
@@ -15,15 +15,18 @@
|
|||||||
#
|
#
|
||||||
# TODO(sop): Remove hack after Buck supports Eclipse
|
# TODO(sop): Remove hack after Buck supports Eclipse
|
||||||
|
|
||||||
from os import path, link
|
from os import path, symlink
|
||||||
import re
|
import re
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
from sys import argv
|
from sys import argv
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
|
||||||
OUT = argv[1] if len(argv) >= 2 else None
|
OUT = argv[1] if len(argv) >= 2 else None
|
||||||
ROOT = path.dirname(path.dirname(path.abspath(__file__)))
|
ROOT = path.abspath(__file__)
|
||||||
MAIN = ['//:eclipse_classpath']
|
for _ in range(0, 3):
|
||||||
|
ROOT = path.dirname(ROOT)
|
||||||
|
|
||||||
|
MAIN = ['//tools/eclipse:classpath']
|
||||||
GWT = ['//gerrit-gwtui:ui_module']
|
GWT = ['//gerrit-gwtui:ui_module']
|
||||||
JRE = '/'.join([
|
JRE = '/'.join([
|
||||||
'org.eclipse.jdt.launching.JRE_CONTAINER',
|
'org.eclipse.jdt.launching.JRE_CONTAINER',
|
||||||
@@ -115,4 +118,4 @@ p = path.join(ROOT, '.classpath')
|
|||||||
with open(p, 'w') as fd:
|
with open(p, 'w') as fd:
|
||||||
doc.writexml(fd, addindent = ' ', newl = '\n', encoding='UTF-8')
|
doc.writexml(fd, addindent = ' ', newl = '\n', encoding='UTF-8')
|
||||||
if OUT:
|
if OUT:
|
||||||
link(p, OUT)
|
symlink(p, OUT)
|
@@ -19,7 +19,9 @@ from os import path, symlink
|
|||||||
from sys import argv
|
from sys import argv
|
||||||
|
|
||||||
OUT = argv[1]
|
OUT = argv[1]
|
||||||
ROOT = path.dirname(path.dirname(path.abspath(__file__)))
|
ROOT = path.abspath(__file__)
|
||||||
|
for _ in range(0, 3):
|
||||||
|
ROOT = path.dirname(ROOT)
|
||||||
|
|
||||||
p = path.join(ROOT, '.project')
|
p = path.join(ROOT, '.project')
|
||||||
with open(p, 'w') as fd:
|
with open(p, 'w') as fd:
|
Reference in New Issue
Block a user