diff options
author | Tor Norbye <tnorbye@google.com> | 2014-03-10 13:13:45 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-03-10 13:13:51 -0700 |
commit | 1fff8e2b7bbcfdea262d3782d4307ca6437da2a3 (patch) | |
tree | 2709e256856c1d80b5cf344b7b0c292a756a2842 /jps | |
parent | 88f318c9bf709fa5700350636925f2c46d6ae08d (diff) | |
download | idea-1fff8e2b7bbcfdea262d3782d4307ca6437da2a3.tar.gz |
Snapshot ae49fc0ed43dd87b534931e62fceae2bcac4fdf1 from idea/134.1445 of git://git.jetbrains.org/idea/community.gitsnapshot-master
ae49fc0: scala 0.32.(593|562|558|550) and AngularJS 0.1.(8|9) marked as incompatible
c3a2e25: Remove unused variable
fe44c93: Multicaret XML: fix type handler for multicaret mode
94108b1: IDEA-121711 Breakpoints dialog: cannot select items in Field Watchpoints section
4933fb4: Add AngularJS plugin
c0ee8f0: IntelliJ Idea 13.1 artworks
95977a0: new inference: cleanup
b3b99f4: ensure order
e9d3421: update button on installed plugins panel
5237f29: IDEA-121151 Breakpoints dialog: Group by Package / File shows exception items in wrong branch
6289c57: show information about multiple carets in status bar (IDEA-80056)
9ac9b91: add getCaretCount method to caret model API (IDEA-80056)
37b836c: WEB-11122 we cannot trust editor width — it could be 0 in case of soft wrap even if editor has text
ad2e3a9: nashorn: frames view — correct presentation of stack frame (function name is not yet displayed)
35fd0fc: cleanup
a433603: Use new icons and fgs
f9e15e0: CPP-6: Parameter info highlighting is messed up + review CR-IC-4631
d158a03: editorPaintStart useless in our case
d22cffe: don't paint in the overlapped region
3181d9a: CR-IC-4638 EvaluateInConsoleFromTreeAction
aa9d729: refactoring branch actions
367266a: style: sort hg reference names in getNamesWithoutHashes, unnecessary ui model creation removed
f0aba00: style: ternary operator used instead of several if-statements; comment added; unnecessary pool thread removed
58d9042: IDEA-121096 The ability to delete Mercurial bookmark
1a11673: IDEA-109794 ability to push mercurial bookmark
e4edbe9: hg action dialog refactoring
d61ace7: optimization broke code (IDEA-118426)
0da53a2: add new plugins icons
fe4a2a0: plugin update icon
9f5335b: plugin restart icon
24aab3b: plugin icon with JB logo
43e5b58: IDEA-121589 Breakpoints dialog: breakpoint categories should be present in a fixed order
f1f1141: IDEA-121675 Nashorn: Debug: RunToCursor is always disabled when js file is active
5b29ebf: Merge remote-tracking branch 'origin/master'
6893d29: revert
21068c7: scene builder: embedder
14de5df: Merge branch 'python-fixes'
7a968d0: IDEA-121642 Breakpoints dialog: closing "Disabled until" hides preview
b3a39df: caret listeners API change (IDEA-80056)
d98f5f7: IDEA-103517 diff: fix diff invocation from history tab
de02a90: revert incorrect change: BuildManager was not notified about files changes at all
e3f3e5f: notnull
6b3a754: cleanup
39bfb97: notnull
0fdd39a: CAPACITY inlined
337138e: CR-IC-4638 we must use "XDebugger", but not "Debugger"
1f2dd56: cleanup
33b0145: IDEA-121675 Nashorn: Debug: RunToCursor is always disabled when js file is active
f4d0239: fix exception at completion when multiple carets are enabled (IDEA-80056)
bc22d75: Compare sys.path roots by virtual file, not by filename because of *.egg archives
90bd285: Extracted getSdkRootVirtualFile()
0eab6fd: test framework: refresh module file
0c1cf4d: Cleanup (pointless exceptions; field extracted; arrangement)
b5a2bae: Cleanup (unused class)
5455508: Cleanup (pointless exceptions dropped)
bc72137: cleanup
3ff0739: NotNull
911290e: cleanup
b770509: cleanup
7d78ad3: cleanup
effe895: cleanup
126f4a0: cleanup
0e49f4a: anonymous -> lambda/method ref: highlight as unused symbol new ClassReference
9860e6b: migration inspection: assign weak warning to produce annoyance
380c7a9: testdata for IDEA-121661
0fa7d08: IDEA-121658 Java 1.8: "Replace with forEach" quick fix is not suggested if for statement is not surrounded with braces
c692398: Local History change temporarily reverted
803d865: IDEA-121640 Breakpoints conversion: conditions and log message languages all turn to Java
d1194fb: IDEA-121643 Breakpoints conversion: exception breakpoint dependencies are lost
95069e7: IDEA-121644 Breakpoints conversion: wildcard method breakpoints get Method entry = Method exit = true
02387b0: IDEA-121632 DomStubBuilder#getStubVersion does not use DomFileDescription#getStubVersion
01a42e5: IDEA-121632 DomStubBuilder#getStubVersion does not use DomFileDescription#getStubVersion
d05d6cd: IDEA-121555 github: get host from url before comparison
314a555: Storyboard format
8181cdb: IDEA-82129 diff: fix synchronized scrolling in merge dialog for left-middle panels
7d76faf: diff: replace Pair by container class
6baec97: repeatCount mostly done
9f2cf02: cleanup — inline
5ff9d4f: improvements for multi-caret implementation of column mode (IDEA-80056)
46208da: EA-53845 added logging
fdecf55: IDEA-121409, IDEA-120908 revert GrReassignedInClosureLocalVariableInspection back to previous state. So it doesn't check plain assignments to locals
9b9ffdb: Merge branch 'master' of git.labs.intellij.net:idea/community
f2d2e79: IDEA-120027 - Import Git-cloud apps from sources - refactor out account selection panel
121f738: IDEA-120027 - Import Git-cloud apps from sources - refactor out deployment detector
989fa1b: IDEA-121635 Injected fragment editor fails with \r\n in text
cc11811: Fix cloning sdk additional data.
7cfb673: Merge remote-tracking branch 'origin/master'
f30ac9d: Merge remote-tracking branch 'origin/master'
e31638a: IDEA-121621 Java 1.8: "Replace with collect" quick fix inserts unresolved method reference
1ae653c: Fix update of terminal input action wrapper.
fb14201: IDEA-116760 Mousing over "tool popup" button causes funny behavior
ece8311: file and doc mod stamps should be equal after save
e30e9ff: EA-53865 - assert: CachedValueProvider$Result.<init>
b5deb1d: Merge remote-tracking branch 'origin/master'
94ae901: PY-12178 Support pull up / push down for properties
27fb3a4: Local History fix: load file children on fileCreated event
5de8d20: a test for IDEA-121301 Setting a breakpoint after navigation to a folded method
a337747: use origin fqn
2a60f15: support ColorUIResource
16fa597: Merge remote-tracking branch 'origin/master'
6dd7d9d: parameter info: proper highlighting for text with XML escaped chars, e.g "map<string, int> &x" +review CR-IC
a3141a4: Merge branch 'python-fixes'
c6947e3: IDEA-108454 (test added)
7ba0d53: Merge remote-tracking branch 'origin/master'
5b6bfba: Disable default breakpoints in env debugger tests.
de2bcc9: Better logging in debugger communication.
f65481f: ResumeAction -> DumbAware
5312f17: IDEA-121301 Setting a breakpoint after navigation to a folded method
b82ea0b: updater: use system look&feel
76b0d68: CR-IU-615 (reworked)
09d9083: WI-22345 Fragment editor: typing causes Throwable at CompletionAssertions.assertCommitSuccessful()
65e4c34: Merge remote-tracking branch 'origin/master'
53752af: fixed PY-12321 PyCharm fails to auto-complete inherited PyQt methods
93eaeb4: Merge remote-tracking branch 'origin/master'
0a93c40: IDEA-121551 please sign runnerw.exe and commit
ec8c8eb: Breakpoint remove should be executed in write action like breakpoint add in XDebuggerTestUtil.
49a5a3f: don't duplicate symlink in suggested interpreter path
f673815: Fix creation of remote sdk in tests.
7a6a957: fix entities resolve without root tag
bd73c79: completion for html5 entities without root tag
41aaf52: #WEB-11032 fixed
9483000: external build: added API to allow plugins extend external build launcher classpath
465090e: Storyboard format
53d95f8: fetch commandLine from processHandler instance if possible
329b1a7: Merge remote-tracking branch 'origin/master'
dd2e76a: PY-12178 Support pull up / push down for properties
550a7e4: EvaluateInConsole
62cf3bb: ActionUtil.getActions
b01a8f1: use SmartList
f95d39d: Merge remote-tracking branch 'origin/master'
b7dca13: added browse interpreter button to create virtual env dialog
64fccff: IDEA-121378 Groovy: inspections: Access to untyped expression reports this and super
1b0f4e8: IDEA-121420 ctrl+b on "def" keyword of a variable without explicit type with initializer should navigate to inferred type
ed39848: IDEA-121140 format spock tables in the end of a file
f2fea0a: external build: added API to prepare custom java compilation task and provide default options for java compiler
0203ec8: Merge remote-tracking branch 'origin/master'
5acf645: Merge remote-tracking branch 'origin/master'
18dbd58: Merge remote-tracking branch 'origin/master'
f8f3d97: lambda: do not try to annotate super method with Nullable from lambda body (IDEA-120205) annotation for super methods was removed by cdr
a4977be: lambda/method refs: provide super class navigation - ctrl-u/line markers (IDEA-120160)
f1dac13: Deprecated remote sdk api. Old legacy classes leaved for compatibility.
4a4d94f: Merge remote-tracking branch 'origin/master'
59525f3: prepared copy of log4j before exec updater to avoid similar issue: WEB-11207 Patch to 8.0 build 134.1361 fails on Win 8.1
179bdc5: support null-values
fe93f3f: Query only the first result of super and overring method searches for performance resaons
6b1189e: more diagnostics for EA-50865 - assert: CachedValueProvider$Result.<init>
5396644: IDEA-121387 Breakpoints dialog: Exception breakpoints: no language chooser for Condition
279b7c3: EA-52976 - assert: CodeFoldingManagerImpl.releaseFoldings
00dbd95: Reuse resolve context with type eval context from the current inspection session for performance reasons
5313d0b: WI-14345 Dictionary: Missing Word "Fundraising"
f4d98a3: IDEA-121505 Breakpoint properties popup: More link does not work if over tool window splitter
fa27e1a: IDEA-121508 Breakpoints in JSP scriptlets are ignored
957b622: CR-IC-4621 allow evaluation in global context (without suspend context)
363a27a: overrides
9ef0155: finalize
ad6c95a: cleanup — move DisabledActionHandler to platform +review
e98cb45: cleanup
19adc49: cleanup
539e45a: Multicaret: fix tests
ede0620: fixed memory leak
6b8002e: Cache return types of callables using TypeEvalContext.getReturnType()
9ca3e42: IDEA-121582 (less spam in log)
b9b76dc: java: type annotations
b428981: java: shorten references after refactoring
d728fd7: IDEA-121518 Cannot edit files in IDEA after project opening: initial folding in opening thread, assertions relaxed
5ed9d91: better diagnostics
b1ae53c: javadoc
2691cb0: external build: ignore irrelevant messages in stderr of javac server (e.g. warnings from log4j)
a487452: continue WEB-10187 inspect objects in console
1a5af0d: more correct and concrete javadoc — it is NOT text, it is just highlighting
fc8c136: IDEA-121531 False positive for "Named arguments are not allowed inside index operations"
7a0eff4: external build: extracted extension point to support custom java compilers
0c6f4d1: don't display expanders on disabled components
c34a068: Merge remote-tracking branch 'origin/master'
a71ff7a: Propose to launch vagrant instance on connection to non-running vagrant remote host (PY-8751).
2905258: NotNull annotation for parent component
ea5f0a5: no "loading components" progress for default project
80d6e1f: new inference: use site substitutor during return constraints processing (red code in Collectors)
b55527a: testdata for IDEA-118965
0cb0127: IDEA-121379 ("Remove braces from if statement" is not available on "if" keyword and condition of if-else construct)
2e88d04: revert optimization because it does not optimize
d4883f5: rebuild list on EDT only
139374a: quick evaluate should allow evaluation in global context (without suspend context)
9051157: cleanup
3419368: init WEB-10187 inspect objects in console
14490aa: overrides
f9eaaef: IDEA-115491 Fragment editor > Save as: provide default directory
a2007d9: IDEA-115490 Fragment editor > Save as: forbidden default name
282ebd2: FormatterTestCase should be available to plugin developers
c4ee509: IDEA-121553 Converted field and exception breakpoints are not available to user
60dfeb6: EA-41231 (better diagnostic)
cec4bb0: show options in create new project instead of show dialog
851c599: fix highlighter update on FileContentUtil.reparseFiles()
842cb01: avoid PSI tree change listener leaks in breakpoint popup
7e61326: avoid PSI tree change listener leaks
a445e2c: table greyer (ability to disable a table)
dff15af: IDEA-105047 Map help button and F1 of the Breakpoints dialog
06fbfa3: WEB-11122 LiveConsole: do not hide input/output
e7ed9a2: cleanup use EditorUtil.scrollToTheEnd
2b22f1a: IDEA-121445 Incomplete breakpoint background highlighting
6cb7fe8: use SmartList
132c8d9: cleanup
34499ed: cleanup
9f501ce: Merge remote-tracking branch 'origin/master'
bbb835a: IDEA-121530 New Mac Messages: 'Invalidate caches' message (with 4 buttons) has one button cut off - First part. The message should be re-layouted. Currently, where is an empty space in the top right part of the message.
524e89e: fix AIOOBE
ee029e5: EA-33362 - assert: DocumentImpl.createRangeMarker
e2b452b: Merge remote-tracking branch 'origin/master'
551e0c5: fixed PY-12228 Project Interpreter: not possible to remove default-located interpreter from the list
df34787: IDEA-121533 INRE at com.intellij.util.indexing.FileBasedIndexImpl.a
a45e0df: EA-41231 (diagnostic)
1e94edc: Shadows improvement
cc01459: WEB-11194 runnerw.exe not working on win XP
10543d4: EA-54083, EA-54446 (premature disposal of default project prevented)
f455420: Merge remote-tracking branch 'origin/master'
0878209: Merging more than one newline in multi-line strings (PY-5532).
e3a7ad9: Implement 'Select all occurrences' action
3b82bfe: fixed PY-12211 Virtualenv interpreters associated with the current project are unsorted
e700d39: Merge remote-tracking branch 'origin/master'
7683348: updated after review.
25d38b4: fixed - toggle method breakpoint action added new breakpoint
d11a471: EA-52809 - IAE: GrClosureType.<init>
e8a5a73: EA-53171 Extracted a separate class for caching type definition stuff. Used CachedValueManager for caching class members, caches depends on its type definition changes and out_of_code_block_modification due to many synthetic members of a class get invalidated independently from its class.
287c82f: Removed TypeEvalContext parameter from PyType.isBuiltin()
466cbf4: EA-54177 - assert: Alarm._addRequest
168a1bc: show paths for detected sdk
eb3695f: new inference: non wildcard parametrization: reject primitive bounds
ab2348a: new inference: diamond in lambda return workaround
7fa42a6: java 1.8, stream api migration: temp disable for generics methods
6087cba: java 1.8, stream api migration: convert to method refs
fb65345: java 1.8, stream api migration: shorten class names
4e6b18e: switch on inplace scene builder
bae5e2a: IDEA-110943 apply patch: Do not add "-" at the end of new file - Part2
2544895: IDEA-121502 Breakpoint condition language is reverted to default once breakpoint properties opened
d96e7b4: do resolve symlinks in suggested python sdks
a52288b: IDEA-110943 apply patch: Do not add "-" at the end of new file
de93417: IDEA-121371 diff: change action caption
7805c3d: Merge remote-tracking branch 'origin/master'
e77d5bb: Switched to @NotNull call site in Callable.getCallType() and PyCallableType.getCallType()
9b235a9: updated after review.
eb0b14f: Changed Callable.getCallType() with explicit 'null' call site to Callable.getReturnType()
dd898e2: Introduced Callable.getCallType() instead of PyFunctionImpl.getReturnTypeWithoutCallSite()
112519d: Merge remote-tracking branch 'origin/master'
4f8a937: IDEA-73814 Scratchpad
257ba94: updated after review.
032ad71: Inlined getGenericReturnType()
888edb9: IDEA-121491 Breakpoints inside anonymous class used in a field initializer
9e9e8e5: Cache call site independent return types of callables in TypeEvalContext
513e07d: EA-54475
27ffe06: CR-IC-4596 (formatting)
f0d970f: use correct concurrency primitive
90c2460: notnull
4c29f54: javadoc
9b88e07: Merge remote-tracking branch 'origin/master'
a456069: diamonds are not available at this language level - testdata fixed
0cab1e2: java 1.8, stream api migration: collect (to be continued)
3f5e08e: do not throw exception
578ac0e: fix indents in testdata
3f111dc: EA-53845 fixed NPE. ProjectRootManager obviously cannot be obtained if delegate.getProject() == null. Some @NotNull & @Nullable added in relative places
2ff02a9: cleanup
f90ee78: Added Callable.getReturnType() and PyTypeProvider.getReturnType()
54786f4: Renamed PyTypeProvider.getReturnType() to getCallType()
ed026c0: Renamed Callable.getReturnType() to getCallType()
1f721bb: Added PyCallableType.getReturnType() for forthcoming return types caching
f65c546: myWatchedProjectCount should be nonnegative
3c66f51: introduced idea.no.system.path.space.monitoring property to skip checks for free space because it fails for yet unrecognized reasons (IDEA-118718)
2fb4a97: JavaFX Scene Builder integration
956b0e3: Exclude ui-designer-core from plugins
8339440: IDEA-121423 Groovy: don't add type arguments to text for reference generating since it can contain lexical errors. Add type arguments to generated reference instead.
fd724d2: IDEA-121082 Enter License dialog: cannot enter data if JetBrains Account fails or returns several licenses
1e5e753: IDEA-121359 License dialog: Undo not working in textfields
cb0399a: check for closure parameters: use method call conversion rules
914d6d4: Groovy: inference of closure parameter types: checks for explicitly declared types.
9446712: Duplicated error messages in @CompileStatic context fixed. Recoursive visitor is replaced with simple visitor, so we don't go inside child psi elements which can be inside @CompileStatic context
b7ba76c: Groovy: Support all ClosureSignatureHints
8951234: FromString hint: support correcr format. it describes a whole signature inside a single string.
22d33a0: ClosureSignatureHint works for closures with several parameters without declared types
d6f0faf: FromString hint: support options with a single String arg instead of an array of Strings
f30ccd9: Groovy: update mock groovy-2.3 build
258c222: Groovy: infrastructure for @ClosureParams support. FromString closure signature hint is supported
965c9b8: redundant code
17ad0ad: EA-53885 - CCE: GrIntroduceParameterProcessor.findUsages in-place introduce parameter is supported only for methods right now
d1b1b43: EA-54370 - IAE: GrIntroduceHandlerBase.getAnchor anchor should be @Nullable to get appropriate log message in case of null
d677a38: some null checks and cleanup
e5b4876: diff: DiffFragment.unchanged -> isEqual() == true
61b2c2a: diff: cleanup
b4a0790: Merge remote-tracking branch 'origin/master'
ac6700b: IDEA-121418 Update to EAP 134.1342 fails with access denied
41a88a4: diff: remove code duplication
45caaf6: diff: move HighlightingMode logic to TextCompareProcessor
ea4d527: EA-54427 - IAE: DiffUtil.getFramingColor
a30e0c6: Merge branch 'two-factor-auth'
49a7d1c: Merge branch 'diff-string'
eed23e9: diff: fix patience diff
442a1ad: Changes according to CR-IC-4570 (using VirtualFileWithId) and CR-IC-4490 (double checked locking)
01d1d11: A standalone EnforcedPlainTextFileTypeManagerTest
8207bd5: java: shorten references after refactoring
5cd9656: EA-54400 (getChildren() consistency guaranteed)
87f8b0f: search indexed files first, then elsewhere (not only whole-words, IDEA-121444)
d7e9631: search whole-words-only in indexed files first, then elsewhere (IDEA-121444)
9dab141: extract project scanning functionality to FindInProjectTask
7bc8adb: FindInProjectUtil cleanup & shortening
fbf5bbe: GeneralCommandLine: 'warn' level changed to 'info' level
7647e15: fix compilation under 1.8
e268b4d: EA-54442 - assert: ComponentManagerImpl.getComponent
c2bee64: restore error on diamonds under 1.6 (IDEA-121377)
0407c16: new inference: cleanup
d8b3e5c: new inference: captures should stay closed inside nested calls
e683dc8: new inference: wildcard parametrization for lambda with formal params: assignability check for complete parametrization only
cfcc34b: IDEA-121251 (stray annotation highlighted)
b8e291a: better tracing resource problem
32c5c60: correctly serialize multiline conditions and log messages
e78e195: do not save null in text and extra text
055191e: use chunk.getPresentableShortName in FormsInstrumenter
6a70bb8: regression: IDEA-121390 Breakpoints: mute on / off: breakpoint appearance updates only on focus change
f23249b: avoid type warning
0d528ac: use trove collections
3c4c139: IDEA-120290 Deprecated methods in import popup.
10ab0f9: don't enumerate all chunk members in compiler status messages
8e74f05: IDEA-121433 ('Auto-unboxing' inspection misses cases)
3a48f58: Merge remote-tracking branch 'origin/master'
1c9512a: Deployment based remote interpreters.
9cfc582: New plugin description
362d96b: New plugin description
a80e03c: New plugin description
7a68bd8: New plugin description
b3d6fcf: issue a clear compilation error when there's no groovy library
6fa1f58: IDEA-117325 Coloring of variable disappears when variable reassigned a value inside an if(){}
35040d4: IDEA-121253 Allow to edit/add contract annotation for library method at usage location
d5e833a: Merge remote-tracking branch 'origin/master'
a047666: new inference: non wildcard parametrization against the spec
ef581ff: restored method breakpoints notification
903d9cf: IDEA-121187 ("Method names differ only by case" is reported even if methods are different not only by case, but by signature as well)
59b0d0e: New plugin description
32e6a78: New plugin description
4da6bed: New plugin description
8f245e8: Merge branch 'python-fixes'
d99cf43: new "'ThreadLocalRandom' instance might be shared" inspection
728b702: improve description
b074b52: allow to set process handler
097ec87: Merge remote-tracking branch 'origin/master'
5ffd591: 'default charset for property files' option won't be ignored anymore
1234810: IDEA-120811 compile-server process hung with 0 CPU
a77644f: IDEA-117380 Can't remove multiple Maven projects at the same time
ff6b7d9: IDEA-121389 Breakpoint tooltip: duplicated information and red color
87346e3: Merge remote-tracking branch 'origin/master'
f26a54a: there is no template stuff in python community
e5552d8: fixed pycharm community detection
69cc1ef: remove GppCompilerTest
833bcfd: initialize LineSet before document changes
0ca5300: more tracing for myWatchedProjectsCount
99d35bf: IDEA-121393 Breakpoint: enabled breakpoint does not update its icon appearance
88b3931: License dialog: we don't need JBA availability check if actual license is JBA.
8fd9111: Fix for JToggleButton (we had no specific UI for Darcula/IntelliJ before)
f4ca614: Rename undo selection action
69b5912: Saving and loading of remote interpreters settings.
e7fd0b6: IDEA-121392 Breakpoint popup: click aside popup loses Suspend = Yes value
780a50b: IDEA-111432 Mnemonics changed for "Preserve case" and "Whole project"
a91ad4a: Don't require PsiFile.getText() for detecting Python charset declaration
3ca9628: remove ControlFlowUtils duplication
a1e2bb8: Remove unused ConditionalUtils
7b53c99: remove SideEffectChecker duplication
bcf9217: remove VariableAccessUtils duplication
a8412d2: plugin advertiser disabled for broken plugins (IDEA-121374)
2994241: Don't crawl down the tree for performance reasons, use cached globals
ba5925e: fixed ContextTest.testXDebugger test
0a6c9ae: test fixed
5690776: save memory on detected line separator
0b40c67: notnull
ed02fc9: optimisation
94f1638: javadoc
d37c7a9: EA-54432 - IAE: XDependentBreakpointManager.getMasterBreakpoint
df6f6f5: do not save empty condition and log message in breakpoints
a7c29b4: LanguageConsoleImpl calls createFile during initialization, so, inherited class cannot override it properly
cf066de: default methods: do not warn about protected methods from Object
5dd3ae6: Merge branch 'python-fixes'
229a0e9: CR-IC-4571 EditorExtensions.xml is overkill
018e061: WEB-4379 Smart step into does not give me all the methods
e79dc61: style
00e2508: IDEA-119238 Git and Hg Amend Commit: amend message updated for multi-root selection changes
e6d6bbb: Merge remote-tracking branch 'origin/master'
58d0444: IDEA-121383 Intellij EAP 1342 Does not start on Mac
39a393c: initialize default breakpoints for new project in tests
25e8977: prepare to fix WEB-4379 Smart step into does not give me all the methods, WEB-4440 Make debugger step inside the anonymous function of the $.each statement by default (or make it at least optional)
dda01ac: overrides, notnull
b6791ca: overrides
f1fef2c: correction to editor fixture to fix failing tests (IDEA-80056)
22985e2: load document LineSet lazily
13e43be: more debugging for GroovyCompilerTest
fdaed62: use IJ index-building classloader to speedup groovyc resolve when it's advantageous
80c7763: testdata fixed
e7cb908: new inference: method refs: apply reference rules first
cf7dff4: Support segue's
22a0e5f: compilation fix
e2c60e5: compilation fix
66a8ded: new inference: method refs: accept qualifier substitutor when nothing more could be inferred
e0f2061: select in project view: preserve registration order to prevent select in Packages by default
b31b23c: new inference: temp solution to exclude inference results from nested call of the same method on the outer level
5dd7e06: new inference: support for nested same method calls
fa6672f: new inference: simplify target type calculation
cbe62cc: new inference: guard fixed
a0f4efc: cleanup after batch folding operation end even in case of exception: to avoid observing invalid fold regions on subsequent batch folding operations
d63786d: allow non java xbreakpoints to be used in debugger-impl
600736c: preserve non java breakpoints in the BreakpointManager
bb586ed: java-xbreakpoints: do not save empty log message
bce82af: java-xbreakpoints: do not save empty conditions
1e9b8fb: java-xbreakpoints: rewrote breakpoints defaults
8541a5c: removed useless string conversion
2991835: java-xbreakpoints: support suspend policy defaults
d3a084dd: java-xbreakpoints: language selection support in condition and log expression
c7b3ad3: renamed attributes for exception breakpoint
b4df1c9: IDEA-121126 Debugger: mute breakpoints: Throwable at ApplicationImpl.assertReadAccessAllowed()
c388cfa: more clear breakpoint serialization format
3391b3b: fixed field and method breakpoints display name
d4f39df: java move to xbreakpoints: - cleanup after review
59b01e4: java move to xbreakpoints: - fixed old any exception breakpoint load
ca6bcc4: java move to xbreakpoints: - fixed breakpoint groupping
525d80d: java move to xbreakpoints 4: - fixed old breakpoints class deserialization
b903d10: java move to xbreakpoints 3: - breakpoint properties serialization fixes - import old java breakpoint - leave a copy for backward compatibility
d492412: java move to xbreakpoints 2: - cleanup - fixed tests - support run to cursor and smart step into - support add field/method breakpoint actions
7a3a6cf: java move to xbreakpoints: - removed java own breakpoints UI - added UI for java filters - added support for all kinds of java breakpoints
88189cc: New plugin description
17c097a: SlimEnterHandler should pass processing
f8d1847: New plugin description
2af38ae: new "Lambda parameter hides field" inspection
1f37c79: fix "Extract parameter as local variable" quickfix for expression lambda's
5fa2222: optimization for inspections tree filtering
a3bbf91: IDEA-105837 Intellij Idea caches maven snapshot dependencies forever
399fdef: fix multi-caret completion issues, make TypedHandlers supporting block selection work also with multiple carets (IDEA-80056)
a3258e2: IDEA-121283 Multiple Carets: Alt-J keyboard shortcut should be changed for Mac
13c7ba0: improve stub-psi-mismatch diagnostic: add language
140bfa4: test from jps modules extracted to separate modules to get rid of cyclic dependencies involving JPS modules
c367db2: 'Select in -> Project Structure' should select corresponding module when invoked on iml file
75feb75: EA-54419 (severity lowered)
93287e7: fixed PY-12248 Project Interpreters: redundant add virtualenv dialog on creating venv from project creation dialog
279985e: Faster isInBuilitins check that doesn't require resolve for non-builtin names
62df9b7: removed generate skeletons action
0cfaba5: New plugin description
2a39a63: IDEA-121285 Maven: missing classifier in managed dependency
16748dc: lazy icons for groovy elements
53ae56b: correct server log location in GroovyCompilerTest
13bfcb5: why does GroovyCompilerTest blink on TC?
5c2b079: IDEA-81276 Show the current program execution point does not bring hidden windows to front
9df88a0: overrides, notnull
4ecfba9: Merge remote-tracking branch 'origin/master'
eb1027b: fixed PY-12251 Project Interpreters: Create virtualenv from settings doesn't update warnigns about python package management tools
08190b2: IDEA-116029 in-place introduce variable name suggestions popup disappears before I can select anything
abf9500: Switched to potentially faster PyBuiltinCache.isInBuilins
7eebbf4: Fix for IDEA-121307 Cannot create new file (StubVirtualFile throws an exception on isDirectory)
daada4c: fixed PY-12257 IOOBE: CreateVirtualEnvDialog.setupDialog
2533839: do not duplicate existing sdks in create virtualenv
b649cb8b: Deprecated PyUtil.getConcealingParent
f16a6dd: Cleanup
ad552ed: CR-IC-4539
64d19ef: Moved isInBuiltins check for expressions to PyBuiltinCache
7113820: Github: do not provide Login/Password AuthData to Git on TwoFactor enabled
9194fc6: Renamed PyBuiltinCache.hasInBuiltins to isBuiltin
a4fef1b: LazyRangeMarkerFactory as project service — reapplied, add missed to RichPlatformPlugin.xml
82a44a6: Github: inspection warnings
92e93ca: Github: AtomicRef -> Ref
6a683af: Github: codereview
16d681e: Github: rewrite AuthDataHolder
741c46d: Github: do not rethrow exception twice
a33d7ef: Github: enable twofactor authorization
1f9c6da: EA-51130 (use data class' loader to register data flavor)
6f684e8: IDEA-121338 Multiple Carets: Menu items for multiple cursors are empty
50ad473: Revert: LazyRangeMarkerFactory as project service (b51fb7bf126a8c95ebf2223fb51c4b1d3faaa558)
e2b1588: ability to create OpenFileDescriptor using RangeMarker +review
d0ade84: LineColumnLazyMarker must compute delegate on start/end offset request +review
b51fb7b: LazyRangeMarkerFactory as project service +review
7cb4315: cleanup
104549e: update action presentations even if there are no mouse or key events
14e2cd6: fixed PY-12259 Assertion error on collecting Python installations on Mac
487e7c3: fixed PY-12261 Memory leak detected in python sdk details dialog
7e47f0e: UsefulTestCase.assertExists/assertDoesntExist for io.File
52ec148: platform: mute system notifications in tests and headless mode
5d41414: Switched from ArrayList to array for annotators for performance reasons
3174f1f: Merge remote-tracking branch 'origin/master'
340bdef: reverted nack template language selection to template language configurable (we don't have any template stuff in community edition)
ec14400: optimized icons
c741b28: Merge remote-tracking branch 'origin/master'
da79a3f: fixed PY-12267 Project Interpreters: inconsistent path separators for virtualenvs and base interpreters
abc49c3: added application root to the SDK search path on window (Education Edition attempt)
e1f5eb1: diff: do not create LineSeparator string every time
a7478db: diff: fix typo
41eed85: diff: rewrite DiffFragment
61dd3cd: diff: unify LineTokenizers
5ca37a6: diff: DiffString
c99c548: diff: fix patience diff
3717b9a: PY-12178 Support pull up / push down for properties (not ready yet: only properties excluded from other managers)
ad37f51: Merge remote-tracking branch 'origin/master'
eac76aa: fixed PY-12270 Project Interpreters: interpreter gets duplicated when hitting apply in multi-project settings window
094ac61: Merge remote-tracking branch 'origin/master'
5d4d015: Merge branch 'PY-10179' of https://github.com/Amarchuk/intellij-community into Amarchuk-PY-10179
be55f15: Merge remote-tracking branch 'origin/master'
68cfa2b: UI to create remote interpreter based on Vagrant.
150483d: fixed PY-12271 Project Interpreter: not able to set interpreter from Project Interpreters dialog when there are duplicated items in the list
40dd069: fixed PY-12272 Project Interpreter Setting Page: invalid alignment for multiproject list and packages table
3d19968: fix multi-line string with single quotes problem PY-12223
bf7f424: fix problem with single quote in project path http://youtrack.jetbrains.com/issue/PY-10179
Change-Id: I85e3d2231109799aab216989c887e0e48c87badb
Diffstat (limited to 'jps')
34 files changed, 463 insertions, 185 deletions
diff --git a/jps/jps-builders/jps-builders.iml b/jps/jps-builders/jps-builders.iml index fea80a020e80..9dd56d591d6e 100644 --- a/jps/jps-builders/jps-builders.iml +++ b/jps/jps-builders/jps-builders.iml @@ -36,6 +36,7 @@ <orderEntry type="module" module-name="jps-model-serialization" /> <orderEntry type="module" module-name="jps-model-impl" /> <orderEntry type="library" scope="TEST" name="Groovy" level="project" /> + <orderEntry type="module" module-name="jps-serialization-tests" scope="TEST" /> </component> </module> diff --git a/jps/jps-builders/src/META-INF/services/org.jetbrains.jps.builders.java.JavaCompilingTool b/jps/jps-builders/src/META-INF/services/org.jetbrains.jps.builders.java.JavaCompilingTool new file mode 100644 index 000000000000..f26b04843daf --- /dev/null +++ b/jps/jps-builders/src/META-INF/services/org.jetbrains.jps.builders.java.JavaCompilingTool @@ -0,0 +1,2 @@ +org.jetbrains.jps.builders.impl.java.JavacCompilerTool +org.jetbrains.jps.builders.impl.java.EclipseCompilerTool
\ No newline at end of file diff --git a/jps/jps-builders/src/org/jetbrains/jps/ModuleChunk.java b/jps/jps-builders/src/org/jetbrains/jps/ModuleChunk.java index 683a8b02abb0..5f74fa20db0d 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/ModuleChunk.java +++ b/jps/jps-builders/src/org/jetbrains/jps/ModuleChunk.java @@ -50,6 +50,21 @@ public class ModuleChunk { myContainsTests = containsTests; } + public String getPresentableShortName() { + String name = myModules.iterator().next().getName(); + if (myModules.size() > 1) { + name += " and " + (myModules.size() - 1) + " more"; + String fullName = getName(); + if (fullName.length() < name.length()) { + name = fullName; + } + } + if (containsTests()) { + name = "tests of " + name; + } + return name; + } + public String getName() { if (myModules.size() == 1) return myModules.iterator().next().getName(); return StringUtil.join(myModules, GET_NAME, ","); diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/EclipseCompilerTool.java b/jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/EclipseCompilerTool.java new file mode 100644 index 000000000000..bea32c02b013 --- /dev/null +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/EclipseCompilerTool.java @@ -0,0 +1,94 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.builders.impl.java; + +import com.intellij.openapi.util.text.StringUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jps.builders.java.CannotCreateJavaCompilerException; +import org.jetbrains.jps.builders.java.JavaCompilingTool; +import org.jetbrains.jps.cmdline.ClasspathBootstrap; +import org.jetbrains.jps.incremental.CompileContext; +import org.jetbrains.jps.incremental.Utils; +import org.jetbrains.jps.model.java.compiler.JavaCompilers; + +import javax.tools.*; +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.ServiceLoader; + +/** + * @author nik + */ +public class EclipseCompilerTool extends JavaCompilingTool { + @NotNull + @Override + public String getId() { + return JavaCompilers.ECLIPSE_ID; + } + + @Nullable + @Override + public String getAlternativeId() { + return JavaCompilers.ECLIPSE_EMBEDDED_ID; + } + + @NotNull + @Override + public String getDescription() { + return "Eclipse compiler"; + } + + @NotNull + @Override + public JavaCompiler createCompiler() throws CannotCreateJavaCompilerException { + for (JavaCompiler javaCompiler : ServiceLoader.load(JavaCompiler.class)) { + if ("EclipseCompiler".equals(StringUtil.getShortName(javaCompiler.getClass()))) { + return javaCompiler; + } + } + throw new CannotCreateJavaCompilerException("Eclipse Batch Compiler was not found in classpath"); + } + + @NotNull + @Override + public List<File> getAdditionalClasspath() { + for (JavaCompiler javaCompiler : ServiceLoader.load(JavaCompiler.class)) { // Eclipse compiler + final File compilerResource = ClasspathBootstrap.getResourceFile(javaCompiler.getClass()); + final String name = compilerResource.getName(); + if (name.startsWith("ecj-") && name.endsWith(".jar")) { + return Collections.singletonList(compilerResource); + } + } + return Collections.emptyList(); + } + + @Override + public void processCompilerOptions(@NotNull CompileContext context, @NotNull List<String> options) { + for (String option : options) { + if (option.startsWith("-proceedOnError")) { + Utils.PROCEED_ON_ERROR_KEY.set(context, Boolean.TRUE); + break; + } + } + } + + @Override + public List<String> getDefaultCompilerOptions() { + return Collections.singletonList("-noExit"); + } +} diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/JavacCompilerTool.java b/jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/JavacCompilerTool.java new file mode 100644 index 000000000000..976e750fe15d --- /dev/null +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/JavacCompilerTool.java @@ -0,0 +1,82 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.builders.impl.java; + +import com.intellij.util.ExceptionUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jps.builders.java.CannotCreateJavaCompilerException; +import org.jetbrains.jps.builders.java.JavaCompilingTool; +import org.jetbrains.jps.javac.JavacMain; +import org.jetbrains.jps.model.java.compiler.JavaCompilers; + +import javax.tools.*; +import java.io.File; +import java.util.Collections; +import java.util.List; + +/** + * @author nik + */ +public class JavacCompilerTool extends JavaCompilingTool { + @NotNull + @Override + public String getId() { + return JavaCompilers.JAVAC_ID; + } + + @Nullable + @Override + public String getAlternativeId() { + return JavaCompilers.JAVAC_API_ID; + } + + @NotNull + @Override + public String getDescription() { + return "javac " + System.getProperty("java.version"); + } + + @NotNull + @Override + public JavaCompiler createCompiler() throws CannotCreateJavaCompilerException { + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + if (compiler != null) { + return compiler; + } + + String message = "System Java Compiler was not found in classpath"; + // trying to obtain additional diagnostic for the case when compiler.jar is present, but there were problems with compiler class loading: + try { + Class.forName("com.sun.tools.javac.api.JavacTool", false, JavacMain.class.getClassLoader()); + } + catch (Throwable ex) { + message = message + ":\n" + ExceptionUtil.getThrowableText(ex); + } + throw new CannotCreateJavaCompilerException(message); + } + + @NotNull + @Override + public List<File> getAdditionalClasspath() { + return Collections.emptyList(); + } + + @Override + public List<String> getDefaultCompilerOptions() { + return Collections.singletonList("-implicit:class"); + } +} diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/CannotCreateJavaCompilerException.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/CannotCreateJavaCompilerException.java new file mode 100644 index 000000000000..4901a970f3a7 --- /dev/null +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/CannotCreateJavaCompilerException.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.builders.java; + +/** + * @author nik + */ +public class CannotCreateJavaCompilerException extends Exception { + public CannotCreateJavaCompilerException(String message) { + super(message); + } +} diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaBuilderUtil.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaBuilderUtil.java index 35de6680ca87..1f0cd41c7ffa 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaBuilderUtil.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaBuilderUtil.java @@ -21,6 +21,7 @@ import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.io.FileUtil; import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.ModuleChunk; import org.jetbrains.jps.ProjectPaths; import org.jetbrains.jps.builders.BuildRootIndex; @@ -38,6 +39,7 @@ import org.jetbrains.jps.model.library.JpsTypedLibrary; import org.jetbrains.jps.model.library.sdk.JpsSdk; import org.jetbrains.jps.model.library.sdk.JpsSdkReference; import org.jetbrains.jps.model.module.JpsModule; +import org.jetbrains.jps.service.JpsServiceManager; import java.io.File; import java.io.IOException; @@ -79,7 +81,7 @@ public class JavaBuilderUtil { final boolean errorsDetected = Utils.errorsDetected(context); if (!isForcedRecompilationAllJavaModules(context)) { if (context.shouldDifferentiate(chunk)) { - context.processMessage(new ProgressMessage("Checking dependencies... [" + chunk.getName() + "]")); + context.processMessage(new ProgressMessage("Checking dependencies... [" + chunk.getPresentableShortName() + "]")); final Set<File> allCompiledFiles = getAllCompiledFilesContainer(context); final Set<File> allAffectedFiles = getAllAffectedFilesContainer(context); @@ -144,7 +146,7 @@ public class JavaBuilderUtil { } } else { - final String messageText = "Marking " + chunk.getName() + " and direct dependants for recompilation"; + final String messageText = "Marking " + chunk.getPresentableShortName() + " and direct dependants for recompilation"; LOG.info("Non-incremental mode: " + messageText); context.processMessage(new ProgressMessage(messageText)); @@ -172,7 +174,7 @@ public class JavaBuilderUtil { return false; } - context.processMessage(new ProgressMessage("Updating dependency information... [" + chunk.getName() + "]")); + context.processMessage(new ProgressMessage("Updating dependency information... [" + chunk.getPresentableShortName() + "]")); globalMappings.integrate(delta); @@ -281,6 +283,16 @@ public class JavaBuilderUtil { return sdkLibrary.getProperties(); } + @Nullable + public static JavaCompilingTool findCompilingTool(@NotNull String compilerId) { + for (JavaCompilingTool tool : JpsServiceManager.getInstance().getExtensions(JavaCompilingTool.class)) { + if (compilerId.equals(tool.getId()) || compilerId.equals(tool.getAlternativeId())) { + return tool; + } + } + return null; + } + private static class ModulesBasedFileFilter implements Mappings.DependentFilesFilter { private final CompileContext myContext; private final Set<JpsModule> myChunkModules; diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaCompilingTool.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaCompilingTool.java new file mode 100644 index 000000000000..6728cf3c4a20 --- /dev/null +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaCompilingTool.java @@ -0,0 +1,58 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.jps.builders.java; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jps.incremental.CompileContext; + +import javax.tools.*; +import java.io.File; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * @author nik + */ +public abstract class JavaCompilingTool { + @NotNull + public abstract String getId(); + + @Nullable + public String getAlternativeId() { + return null; + } + + @NotNull + public abstract String getDescription(); + + @NotNull + public abstract JavaCompiler createCompiler() throws CannotCreateJavaCompilerException; + + @NotNull + public abstract List<File> getAdditionalClasspath(); + + public void processCompilerOptions(@NotNull CompileContext context, @NotNull List<String> options) { + } + + public void prepareCompilationTask(@NotNull JavaCompiler.CompilationTask task, @NotNull Collection<String> options) { + } + + public List<String> getDefaultCompilerOptions() { + return Collections.emptyList(); + } +} diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ClassRepr.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ClassRepr.java index e104ffd7e630..21818f540cc7 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ClassRepr.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ClassRepr.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -380,12 +380,12 @@ public class ClassRepr extends Proto { public static DataExternalizer<ClassRepr> externalizer(final DependencyContext context) { return new DataExternalizer<ClassRepr>() { @Override - public void save(final DataOutput out, final ClassRepr value) throws IOException { + public void save(@NotNull final DataOutput out, final ClassRepr value) throws IOException { value.save(out); } @Override - public ClassRepr read(final DataInput in) throws IOException { + public ClassRepr read(@NotNull final DataInput in) throws IOException { return new ClassRepr(context, in); } }; diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/FieldRepr.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/FieldRepr.java index b72e5aa18d5b..92359612f034 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/FieldRepr.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/FieldRepr.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.jetbrains.jps.builders.java.dependencyView; import com.intellij.util.io.DataExternalizer; +import org.jetbrains.annotations.NotNull; import java.io.DataInput; import java.io.DataOutput; @@ -57,12 +58,12 @@ class FieldRepr extends ProtoMember { public static DataExternalizer<FieldRepr> externalizer(final DependencyContext context) { return new DataExternalizer<FieldRepr>() { @Override - public void save(final DataOutput out, final FieldRepr value) throws IOException { + public void save(@NotNull final DataOutput out, final FieldRepr value) throws IOException { value.save(out); } @Override - public FieldRepr read(final DataInput in) throws IOException { + public FieldRepr read(@NotNull final DataInput in) throws IOException { return new FieldRepr(context, in); } }; diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntIntPersistentMultiMaplet.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntIntPersistentMultiMaplet.java index eb94639941ac..560c4cecc0fd 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntIntPersistentMultiMaplet.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntIntPersistentMultiMaplet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -256,7 +256,7 @@ class IntIntPersistentMultiMaplet extends IntIntMultiMaplet { private static class IntSetExternalizer implements DataExternalizer<TIntHashSet> { @Override - public void save(final DataOutput out, final TIntHashSet value) throws IOException { + public void save(@NotNull final DataOutput out, final TIntHashSet value) throws IOException { final Ref<IOException> exRef = new Ref<IOException>(null); value.forEach(new TIntProcedure() { @Override @@ -278,7 +278,7 @@ class IntIntPersistentMultiMaplet extends IntIntMultiMaplet { } @Override - public TIntHashSet read(final DataInput in) throws IOException { + public TIntHashSet read(@NotNull final DataInput in) throws IOException { final TIntHashSet result = new TIntHashSet(); final DataInputStream stream = (DataInputStream)in; while (stream.available() > 0) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntObjectPersistentMultiMaplet.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntObjectPersistentMultiMaplet.java index d195cbc4fc6f..3dd4d446c99a 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntObjectPersistentMultiMaplet.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/IntObjectPersistentMultiMaplet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -245,14 +245,14 @@ class IntObjectPersistentMultiMaplet<V extends Streamable> extends IntObjectMult } @Override - public void save(final DataOutput out, final Collection<V> value) throws IOException { + public void save(@NotNull final DataOutput out, final Collection<V> value) throws IOException { for (V x : value) { myElementExternalizer.save(out, x); } } @Override - public Collection<V> read(final DataInput in) throws IOException { + public Collection<V> read(@NotNull final DataInput in) throws IOException { final Collection<V> result = myCollectionFactory.create(); final DataInputStream stream = (DataInputStream)in; while (stream.available() > 0) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/MethodRepr.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/MethodRepr.java index 7b55ea7aaa29..72ad7557cd0b 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/MethodRepr.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/MethodRepr.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.jetbrains.jps.builders.java.dependencyView; import com.intellij.util.io.DataExternalizer; import com.intellij.util.io.DataInputOutputUtil; import gnu.trove.THashSet; +import org.jetbrains.annotations.NotNull; import org.jetbrains.asm4.Type; import org.jetbrains.jps.builders.storage.BuildDataCorruptedException; @@ -159,12 +160,12 @@ class MethodRepr extends ProtoMember { public static DataExternalizer<MethodRepr> externalizer(final DependencyContext context) { return new DataExternalizer<MethodRepr>() { @Override - public void save(final DataOutput out, final MethodRepr value) throws IOException { + public void save(@NotNull final DataOutput out, final MethodRepr value) throws IOException { value.save(out); } @Override - public MethodRepr read(DataInput in) throws IOException { + public MethodRepr read(@NotNull DataInput in) throws IOException { return new MethodRepr(context, in); } }; diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ObjectObjectPersistentMultiMaplet.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ObjectObjectPersistentMultiMaplet.java index d94d092b13d1..26a9b7a5756f 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ObjectObjectPersistentMultiMaplet.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/ObjectObjectPersistentMultiMaplet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -245,14 +245,14 @@ public class ObjectObjectPersistentMultiMaplet<K, V extends Streamable> extends } @Override - public void save(final DataOutput out, final Collection<V> value) throws IOException { + public void save(@NotNull final DataOutput out, final Collection<V> value) throws IOException { for (V x : value) { myElementExternalizer.save(out, x); } } @Override - public Collection<V> read(final DataInput in) throws IOException { + public Collection<V> read(@NotNull final DataInput in) throws IOException { final Collection<V> result = myCollectionFactory.create(); final DataInputStream stream = (DataInputStream)in; while (stream.available() > 0) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/TypeRepr.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/TypeRepr.java index dbdb7a9f1179..af85d75f344f 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/TypeRepr.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/TypeRepr.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.jetbrains.jps.builders.java.dependencyView; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.io.DataExternalizer; import com.intellij.util.io.DataInputOutputUtil; +import org.jetbrains.annotations.NotNull; import org.jetbrains.asm4.Type; import org.jetbrains.jps.builders.storage.BuildDataCorruptedException; @@ -280,12 +281,12 @@ class TypeRepr { public static DataExternalizer<AbstractType> externalizer(final DependencyContext context) { return new DataExternalizer<AbstractType>() { @Override - public void save(final DataOutput out, final AbstractType value) throws IOException { + public void save(@NotNull final DataOutput out, final AbstractType value) throws IOException { value.save(out); } @Override - public AbstractType read(final DataInput in) throws IOException { + public AbstractType read(@NotNull final DataInput in) throws IOException { AbstractType elementType; int level = 0; diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/UsageRepr.java b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/UsageRepr.java index 8db8bbc11ec4..a6b6bdd143f5 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/UsageRepr.java +++ b/jps/jps-builders/src/org/jetbrains/jps/builders/java/dependencyView/UsageRepr.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import com.intellij.util.io.DataExternalizer; import com.intellij.util.io.DataInputOutputUtil; import gnu.trove.TIntHashSet; import gnu.trove.TIntProcedure; +import org.jetbrains.annotations.NotNull; import org.jetbrains.asm4.Type; import org.jetbrains.jps.builders.storage.BuildDataCorruptedException; @@ -505,12 +506,12 @@ class UsageRepr { public static class AnnotationUsage extends Usage { public static final DataExternalizer<ElemType> elementTypeExternalizer = new DataExternalizer<ElemType>() { @Override - public void save(final DataOutput out, final ElemType value) throws IOException { + public void save(@NotNull final DataOutput out, final ElemType value) throws IOException { DataInputOutputUtil.writeINT(out, value.ordinal()); } @Override - public ElemType read(final DataInput in) throws IOException { + public ElemType read(@NotNull final DataInput in) throws IOException { final int ordinal = DataInputOutputUtil.readINT(in); for (ElemType value : ElemType.values()) { if (value.ordinal() == ordinal) { @@ -699,12 +700,12 @@ class UsageRepr { public static DataExternalizer<Usage> externalizer(final DependencyContext context) { return new DataExternalizer<Usage>() { @Override - public void save(final DataOutput out, final Usage value) throws IOException { + public void save(@NotNull final DataOutput out, final Usage value) throws IOException { value.save(out); } @Override - public Usage read(DataInput in) throws IOException { + public Usage read(@NotNull DataInput in) throws IOException { final byte tag = in.readByte(); switch (tag) { case CLASS_USAGE: diff --git a/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/TObjectIntHashMapExternalizer.java b/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/TObjectIntHashMapExternalizer.java index c75414079b86..eed818e08567 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/TObjectIntHashMapExternalizer.java +++ b/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/TObjectIntHashMapExternalizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.jetbrains.jps.classFilesIndex; import com.intellij.util.io.DataExternalizer; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntProcedure; +import org.jetbrains.annotations.NotNull; import java.io.DataInput; import java.io.DataOutput; @@ -34,7 +35,7 @@ public class TObjectIntHashMapExternalizer<K> implements DataExternalizer<TObjec } @Override - public void save(final DataOutput out, final TObjectIntHashMap<K> map) throws IOException { + public void save(@NotNull final DataOutput out, final TObjectIntHashMap<K> map) throws IOException { out.writeInt(map.size()); try { map.forEachEntry(new TObjectIntProcedure<K>() { @@ -57,7 +58,7 @@ public class TObjectIntHashMapExternalizer<K> implements DataExternalizer<TObjec } @Override - public TObjectIntHashMap<K> read(final DataInput in) throws IOException { + public TObjectIntHashMap<K> read(@NotNull final DataInput in) throws IOException { final int size = in.readInt(); final TObjectIntHashMap<K> map = new TObjectIntHashMap<K>(size); for (int i = 0; i < size; i++) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/storage/ClassFilesIndexStorageBase.java b/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/storage/ClassFilesIndexStorageBase.java index 4d2b60446b52..1eba7b5f9512 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/storage/ClassFilesIndexStorageBase.java +++ b/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/storage/ClassFilesIndexStorageBase.java @@ -163,7 +163,7 @@ public class ClassFilesIndexStorageBase<K, V> { private static <V> DataExternalizer<CompiledDataValueContainer<V>> createValueContainerExternalizer(final DataExternalizer<V> valueExternalizer) { return new DataExternalizer<CompiledDataValueContainer<V>>() { @Override - public void save(final DataOutput out, final CompiledDataValueContainer<V> value) throws IOException { + public void save(@NotNull final DataOutput out, final CompiledDataValueContainer<V> value) throws IOException { final TIntObjectHashMap<V> underlying = value.myUnderlying; out.writeInt(underlying.size()); final IOException[] ioException = {null}; @@ -187,7 +187,7 @@ public class ClassFilesIndexStorageBase<K, V> { } @Override - public CompiledDataValueContainer<V> read(final DataInput in) throws IOException { + public CompiledDataValueContainer<V> read(@NotNull final DataInput in) throws IOException { final TIntObjectHashMap<V> map = new TIntObjectHashMap<V>(); final int size = in.readInt(); for (int i = 0; i < size; i++) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/impl/EnumeratedMethodIncompleteSignature.java b/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/impl/EnumeratedMethodIncompleteSignature.java index fec5e9acccd7..b93a7da728f5 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/impl/EnumeratedMethodIncompleteSignature.java +++ b/jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/impl/EnumeratedMethodIncompleteSignature.java @@ -53,14 +53,14 @@ public class EnumeratedMethodIncompleteSignature { public static DataExternalizer<EnumeratedMethodIncompleteSignature> createDataExternalizer() { return new DataExternalizer<EnumeratedMethodIncompleteSignature>() { @Override - public void save(final DataOutput out, final EnumeratedMethodIncompleteSignature value) throws IOException { + public void save(@NotNull final DataOutput out, final EnumeratedMethodIncompleteSignature value) throws IOException { out.writeInt(value.getOwner()); out.writeInt(value.getName()); out.writeBoolean(value.isStatic()); } @Override - public EnumeratedMethodIncompleteSignature read(final DataInput in) throws IOException { + public EnumeratedMethodIncompleteSignature read(@NotNull final DataInput in) throws IOException { return new EnumeratedMethodIncompleteSignature(in.readInt(), in.readInt(), in.readBoolean()); diff --git a/jps/jps-builders/src/org/jetbrains/jps/cmdline/ClasspathBootstrap.java b/jps/jps-builders/src/org/jetbrains/jps/cmdline/ClasspathBootstrap.java index d2b4c7f3210b..c89cb50397fb 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/cmdline/ClasspathBootstrap.java +++ b/jps/jps-builders/src/org/jetbrains/jps/cmdline/ClasspathBootstrap.java @@ -32,15 +32,14 @@ import net.n3.nanoxml.IXMLBuilder; import org.jetbrains.annotations.Nullable; import org.jetbrains.asm4.ClassVisitor; import org.jetbrains.asm4.ClassWriter; +import org.jetbrains.jps.builders.java.JavaCompilingTool; import org.jetbrains.jps.builders.java.JavaSourceTransformer; import org.jetbrains.jps.javac.JavacServer; import org.jetbrains.jps.model.JpsModel; import org.jetbrains.jps.model.impl.JpsModelImpl; import org.jetbrains.jps.model.serialization.JpsProjectLoader; -import javax.tools.JavaCompiler; -import javax.tools.StandardJavaFileManager; -import javax.tools.ToolProvider; +import javax.tools.*; import java.io.File; import java.lang.reflect.Method; import java.util.*; @@ -177,7 +176,7 @@ public class ClasspathBootstrap { } } - public static List<File> getJavacServerClasspath(String sdkHome, boolean useEclipseCompiler) { + public static List<File> getJavacServerClasspath(String sdkHome, JavaCompilingTool compilingTool) { final Set<File> cp = new LinkedHashSet<File>(); cp.add(getResourceFile(JavacServer.class)); // self // util @@ -236,16 +235,7 @@ public class ClasspathBootstrap { } } - if (useEclipseCompiler) { - // eclipse compiler - for (JavaCompiler javaCompiler : ServiceLoader.load(JavaCompiler.class)) { // Eclipse compiler - final File compilerResource = getResourceFile(javaCompiler.getClass()); - final String name = compilerResource.getName(); - if (name.startsWith("ecj-") && name.endsWith(".jar")) { - cp.add(compilerResource); - } - } - } + cp.addAll(compilingTool.getAdditionalClasspath()); final Class<JavaSourceTransformer> transformerClass = JavaSourceTransformer.class; final ServiceLoader<JavaSourceTransformer> loader = ServiceLoader.load(transformerClass, transformerClass.getClassLoader()); diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/artifacts/ArtifactOutputToSourceMapping.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/artifacts/ArtifactOutputToSourceMapping.java index 572433552d65..fa022448ef73 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/artifacts/ArtifactOutputToSourceMapping.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/artifacts/ArtifactOutputToSourceMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.intellij.util.SmartList; import com.intellij.util.io.DataExternalizer; import com.intellij.util.io.IOUtil; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.incremental.storage.AbstractStateStorage; import org.jetbrains.jps.incremental.storage.PathStringDescriptor; @@ -85,7 +86,7 @@ public class ArtifactOutputToSourceMapping extends AbstractStateStorage<String, private final byte[] myBuffer = IOUtil.allocReadWriteUTFBuffer(); @Override - public void save(DataOutput out, List<SourcePathAndRootIndex> value) throws IOException { + public void save(@NotNull DataOutput out, List<SourcePathAndRootIndex> value) throws IOException { for (SourcePathAndRootIndex pair : value) { IOUtil.writeUTFFast(myBuffer, out, pair.myPath); out.writeInt(pair.getRootIndex()); @@ -93,7 +94,7 @@ public class ArtifactOutputToSourceMapping extends AbstractStateStorage<String, } @Override - public List<SourcePathAndRootIndex> read(DataInput in) throws IOException { + public List<SourcePathAndRootIndex> read(@NotNull DataInput in) throws IOException { List<SourcePathAndRootIndex> result = new SmartList<SourcePathAndRootIndex>(); final DataInputStream stream = (DataInputStream)in; while (stream.available() > 0) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java index 092b002f2384..af1c974b84a2 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/ClassProcessingBuilder.java @@ -74,7 +74,7 @@ public abstract class ClassProcessingBuilder extends ModuleLevelBuilder { final String progress = getProgressMessage(); final boolean shouldShowProgress = !StringUtil.isEmptyOrSpaces(progress); if (shouldShowProgress) { - context.processMessage(new ProgressMessage(progress + " [" + chunk.getName() + "]")); + context.processMessage(new ProgressMessage(progress + " [" + chunk.getPresentableShortName() + "]")); } ExitCode exitCode = ExitCode.NOTHING_DONE; diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java index 645cdd648bbb..db1700c47cbd 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java @@ -39,6 +39,7 @@ import org.jetbrains.jps.builders.DirtyFilesHolder; import org.jetbrains.jps.builders.FileProcessor; import org.jetbrains.jps.builders.java.JavaBuilderExtension; import org.jetbrains.jps.builders.java.JavaBuilderUtil; +import org.jetbrains.jps.builders.java.JavaCompilingTool; import org.jetbrains.jps.builders.java.JavaSourceRootDescriptor; import org.jetbrains.jps.builders.java.dependencyView.Callbacks; import org.jetbrains.jps.builders.java.dependencyView.Mappings; @@ -81,7 +82,7 @@ public class JavaBuilder extends ModuleLevelBuilder { public static final boolean USE_EMBEDDED_JAVAC = System.getProperty(GlobalOptions.USE_EXTERNAL_JAVAC_OPTION) == null; private static final Key<Integer> JAVA_COMPILER_VERSION_KEY = Key.create("_java_compiler_version_"); public static final Key<Boolean> IS_ENABLED = Key.create("_java_compiler_enabled_"); - private static final Key<Boolean> IS_COMPILER_API_SUPPORTED = Key.create("_java_compiler_api_supported_"); + private static final Key<JavaCompilingTool> COMPILING_TOOL = Key.create("_java_compiling_tool_"); private static final Key<AtomicReference<String>> COMPILER_VERSION_INFO = Key.create("_java_compiler_version_info_"); private static final Set<String> FILTERED_OPTIONS = new HashSet<String>(Arrays.<String>asList( @@ -137,16 +138,9 @@ public class JavaBuilder extends ModuleLevelBuilder { if (LOG.isDebugEnabled()) { LOG.debug("Java compiler ID: " + compilerId); } - final boolean isJavac = JavaCompilers.JAVAC_ID.equalsIgnoreCase(compilerId) || JavaCompilers.JAVAC_API_ID.equalsIgnoreCase(compilerId); - final boolean isEclipse = JavaCompilers.ECLIPSE_ID.equalsIgnoreCase(compilerId) || JavaCompilers.ECLIPSE_EMBEDDED_ID.equalsIgnoreCase(compilerId); - IS_COMPILER_API_SUPPORTED.set(context, isJavac || isEclipse); - String messageText = null; - if (isJavac) { - messageText = "Using javac " + System.getProperty("java.version") + " to compile java sources"; - } - else if (isEclipse) { - messageText = "Using eclipse compiler to compile java sources"; - } + JavaCompilingTool compilingTool = JavaBuilderUtil.findCompilingTool(compilerId); + COMPILING_TOOL.set(context, compilingTool); + String messageText = compilingTool != null ? "Using " + compilingTool.getDescription() + " to compile java sources" : null; COMPILER_VERSION_INFO.set(context, new AtomicReference<String>(messageText)); } @@ -159,16 +153,17 @@ public class JavaBuilder extends ModuleLevelBuilder { @NotNull ModuleChunk chunk, @NotNull DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder, @NotNull OutputConsumer outputConsumer) throws ProjectBuildException, IOException { - if (!IS_ENABLED.get(context, Boolean.TRUE) || !IS_COMPILER_API_SUPPORTED.get(context, Boolean.TRUE)) { + JavaCompilingTool compilingTool = COMPILING_TOOL.get(context); + if (!IS_ENABLED.get(context, Boolean.TRUE) || compilingTool == null) { return ExitCode.NOTHING_DONE; } - return doBuild(context, chunk, dirtyFilesHolder, outputConsumer); + return doBuild(context, chunk, dirtyFilesHolder, outputConsumer, compilingTool); } public ExitCode doBuild(@NotNull CompileContext context, @NotNull ModuleChunk chunk, @NotNull DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder, - @NotNull OutputConsumer outputConsumer) throws ProjectBuildException, IOException { + @NotNull OutputConsumer outputConsumer, JavaCompilingTool compilingTool) throws ProjectBuildException, IOException { try { final Set<File> filesToCompile = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY); @@ -190,7 +185,7 @@ public class JavaBuilder extends ModuleLevelBuilder { } } - return compile(context, chunk, dirtyFilesHolder, filesToCompile, outputConsumer); + return compile(context, chunk, dirtyFilesHolder, filesToCompile, outputConsumer, compilingTool); } catch (BuildDataCorruptedException e) { throw e; @@ -224,7 +219,7 @@ public class JavaBuilder extends ModuleLevelBuilder { ModuleChunk chunk, DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder, Collection<File> files, - OutputConsumer outputConsumer) + OutputConsumer outputConsumer, @NotNull JavaCompilingTool compilingTool) throws Exception { ExitCode exitCode = ExitCode.NOTHING_DONE; @@ -243,7 +238,7 @@ public class JavaBuilder extends ModuleLevelBuilder { // begin compilation round final Mappings delta = pd.dataManager.getMappings().createDelta(); final Callbacks.Backend mappingsCallback = delta.getCallback(); - final OutputFilesSink outputSink = new OutputFilesSink(context, outputConsumer, mappingsCallback, chunk.getName()); + final OutputFilesSink outputSink = new OutputFilesSink(context, outputConsumer, mappingsCallback, chunk.getPresentableShortName()); try { if (hasSourcesToCompile) { final AtomicReference<String> ref = COMPILER_VERSION_INFO.get(context); @@ -264,7 +259,7 @@ public class JavaBuilder extends ModuleLevelBuilder { final DiagnosticSink diagnosticSink = new DiagnosticSink(context); final String chunkName = chunk.getName(); - context.processMessage(new ProgressMessage("Parsing java... [" + chunkName + "]")); + context.processMessage(new ProgressMessage("Parsing java... [" + chunk.getPresentableShortName() + "]")); final int filesCount = files.size(); boolean compiledOk = true; @@ -284,7 +279,7 @@ public class JavaBuilder extends ModuleLevelBuilder { } } try { - compiledOk = compileJava(context, chunk, files, classpath, platformCp, srcPath, diagnosticSink, outputSink); + compiledOk = compileJava(context, chunk, files, classpath, platformCp, srcPath, diagnosticSink, outputSink, compilingTool); } finally { // heuristic: incorrect paths data recovery, so that the next make should not contain non-existing sources in 'recompile' list @@ -328,7 +323,7 @@ public class JavaBuilder extends ModuleLevelBuilder { Collection<File> platformCp, Collection<File> sourcePath, DiagnosticOutputConsumer diagnosticSink, - final OutputFileConsumer outputSink) throws Exception { + final OutputFileConsumer outputSink, JavaCompilingTool compilingTool) throws Exception { final TasksCounter counter = new TasksCounter(); COUNTER_KEY.set(context, counter); @@ -372,7 +367,7 @@ public class JavaBuilder extends ModuleLevelBuilder { } final Map<File, Set<File>> outs = buildOutputDirectoriesMap(context, chunk); - final List<String> options = getCompilationOptions(context, chunk, profile); + final List<String> options = getCompilationOptions(context, chunk, profile, compilingTool); final ClassProcessingConsumer classesConsumer = new ClassProcessingConsumer(context, outputSink); if (LOG.isDebugEnabled()) { LOG.debug("Compiling chunk [" + chunk.getName() + "] with options: \"" + StringUtil.join(options, " ") + "\""); @@ -380,13 +375,11 @@ public class JavaBuilder extends ModuleLevelBuilder { try { final boolean rc; if (USE_EMBEDDED_JAVAC) { - final boolean useEclipse = useEclipseCompiler(context); - rc = JavacMain.compile( - options, files, classpath, platformCp, sourcePath, outs, diagnosticSink, classesConsumer, context.getCancelStatus(), useEclipse - ); + rc = JavacMain.compile(options, files, classpath, platformCp, sourcePath, outs, diagnosticSink, classesConsumer, + context.getCancelStatus(), compilingTool); } else { - final JavacServerClient client = ensureJavacServerLaunched(context); + final JavacServerClient client = ensureJavacServerLaunched(context, compilingTool); final RequestFuture<JavacServerResponseHandler> future = client.sendCompileRequest( options, files, classpath, platformCp, sourcePath, outs, diagnosticSink, classesConsumer ); @@ -404,13 +397,6 @@ public class JavaBuilder extends ModuleLevelBuilder { } } - private static boolean useEclipseCompiler(CompileContext context) { - JpsProject project = context.getProjectDescriptor().getProject(); - final JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getCompilerConfiguration(project); - final String compilerId = configuration != null? configuration.getJavaCompilerId() : null; - return JavaCompilers.ECLIPSE_ID.equalsIgnoreCase(compilerId) || JavaCompilers.ECLIPSE_EMBEDDED_ID.equalsIgnoreCase(compilerId); - } - private void submitAsyncTask(final CompileContext context, final Runnable taskRunnable) { final TasksCounter counter = COUNTER_KEY.get(context); @@ -432,7 +418,7 @@ public class JavaBuilder extends ModuleLevelBuilder { }); } - private static synchronized JavacServerClient ensureJavacServerLaunched(CompileContext context) throws Exception { + private static synchronized JavacServerClient ensureJavacServerLaunched(@NotNull CompileContext context, @NotNull JavaCompilingTool compilingTool) throws Exception { final ExternalJavacDescriptor descriptor = ExternalJavacDescriptor.KEY.get(context); if (descriptor != null) { return descriptor.client; @@ -445,7 +431,7 @@ public class JavaBuilder extends ModuleLevelBuilder { final String javaHome = SystemProperties.getJavaHome(); final BaseOSProcessHandler processHandler = JavacServerBootstrap.launchJavacServer( - javaHome, heapSize, port, Utils.getSystemRoot(), getCompilationVMOptions(context), useEclipseCompiler(context) + javaHome, heapSize, port, Utils.getSystemRoot(), getCompilationVMOptions(context, compilingTool), compilingTool ); final JavacServerClient client = new JavacServerClient(); try { @@ -529,19 +515,22 @@ public class JavaBuilder extends ModuleLevelBuilder { private static final Key<List<String>> JAVAC_VM_OPTIONS = Key.create("_javac_vm_options_"); private static final Key<String> USER_DEFINED_BYTECODE_TARGET = Key.create("_user_defined_bytecode_target_"); - private static List<String> getCompilationVMOptions(CompileContext context) { + private static List<String> getCompilationVMOptions(CompileContext context, JavaCompilingTool compilingTool) { List<String> cached = JAVAC_VM_OPTIONS.get(context); if (cached == null) { - loadCommonJavacOptions(context); + loadCommonJavacOptions(context, compilingTool); cached = JAVAC_VM_OPTIONS.get(context); } return cached; } - private static List<String> getCompilationOptions(CompileContext context, ModuleChunk chunk, @Nullable ProcessorConfigProfile profile) { + private static List<String> getCompilationOptions(CompileContext context, + ModuleChunk chunk, + @Nullable ProcessorConfigProfile profile, + @NotNull JavaCompilingTool compilingTool) { List<String> cached = JAVAC_OPTIONS.get(context); if (cached == null) { - loadCommonJavacOptions(context); + loadCommonJavacOptions(context, compilingTool); cached = JAVAC_OPTIONS.get(context); assert cached != null : context; } @@ -701,7 +690,7 @@ public class JavaBuilder extends ModuleLevelBuilder { return javaVersion; } - private static void loadCommonJavacOptions(CompileContext context) { + private static void loadCommonJavacOptions(@NotNull CompileContext context, @NotNull JavaCompilingTool compilingTool) { final List<String> options = new ArrayList<String>(); final List<String> vmOptions = new ArrayList<String>(); @@ -755,14 +744,7 @@ public class JavaBuilder extends ModuleLevelBuilder { } } - if (useEclipseCompiler(context)) { - for (String option : options) { - if (option.startsWith("-proceedOnError")) { - Utils.PROCEED_ON_ERROR_KEY.set(context, Boolean.TRUE); - break; - } - } - } + compilingTool.processCompilerOptions(context, options); JAVAC_OPTIONS.set(context, options); JAVAC_VM_OPTIONS.set(context, vmOptions); diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/CompilerMessage.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/CompilerMessage.java index 9d34bbb05366..2d40d9faf1e6 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/CompilerMessage.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/messages/CompilerMessage.java @@ -37,19 +37,19 @@ public class CompilerMessage extends BuildMessage { private final long myLine; private final long myColumn; - public CompilerMessage(String compilerName, @NotNull Throwable internalError) { + public CompilerMessage(@NotNull String compilerName, @NotNull Throwable internalError) { this(compilerName, Kind.ERROR, getTextFromThrowable(internalError), null, -1L, -1L, -1L, -1L, -1L); } - public CompilerMessage(String compilerName, Kind kind, String messageText) { + public CompilerMessage(@NotNull String compilerName, Kind kind, String messageText) { this(compilerName, kind, messageText, null, -1L, -1L, -1L, -1L, -1L); } - public CompilerMessage(String compilerName, Kind kind, String messageText, String sourcePath) { + public CompilerMessage(@NotNull String compilerName, Kind kind, String messageText, String sourcePath) { this(compilerName, kind, messageText, sourcePath, -1L, -1L, -1L, -1L, -1L); } - public CompilerMessage(String compilerName, Kind kind, String messageText, + public CompilerMessage(@NotNull String compilerName, Kind kind, String messageText, @Nullable String sourcePath, long problemBeginOffset, long problemEndOffset, @@ -66,6 +66,7 @@ public class CompilerMessage extends BuildMessage { myColumn = locationColumn; } + @NotNull public String getCompilerName() { return myCompilerName; } diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/FileKeyDescriptor.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/FileKeyDescriptor.java index f467dd27c929..c1c364c22b80 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/FileKeyDescriptor.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/FileKeyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.jetbrains.jps.incremental.storage; import com.intellij.openapi.util.io.FileUtil; import com.intellij.util.io.IOUtil; import com.intellij.util.io.KeyDescriptor; +import org.jetbrains.annotations.NotNull; import java.io.DataInput; import java.io.DataOutput; @@ -31,11 +32,11 @@ import java.io.IOException; public final class FileKeyDescriptor implements KeyDescriptor<File> { private final byte[] buffer = IOUtil.allocReadWriteUTFBuffer(); - public void save(DataOutput out, File value) throws IOException { + public void save(@NotNull DataOutput out, File value) throws IOException { IOUtil.writeUTFFast(buffer, out, value.getPath()); } - public File read(DataInput in) throws IOException { + public File read(@NotNull DataInput in) throws IOException { return new File(IOUtil.readUTFFast(buffer, in)); } diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OneToManyPathsMapping.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OneToManyPathsMapping.java index 2c0516327584..6e8eb8787e00 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OneToManyPathsMapping.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/OneToManyPathsMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,13 +83,13 @@ public class OneToManyPathsMapping extends AbstractStateStorage<String, Collecti private static class PathCollectionExternalizer implements DataExternalizer<Collection<String>> { private final byte[] myBuffer = IOUtil.allocReadWriteUTFBuffer(); - public void save(DataOutput out, Collection<String> value) throws IOException { + public void save(@NotNull DataOutput out, Collection<String> value) throws IOException { for (String str : value) { IOUtil.writeUTFFast(myBuffer, out, str); } } - public Collection<String> read(DataInput in) throws IOException { + public Collection<String> read(@NotNull DataInput in) throws IOException { final Set<String> result = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY); final DataInputStream stream = (DataInputStream)in; while (stream.available() > 0) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/TimestampStorage.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/TimestampStorage.java index 9955c6a64c83..3ebb148ebb71 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/TimestampStorage.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/TimestampStorage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ public class TimestampStorage extends AbstractStateStorage<File, TimestampStorag } private static class StateExternalizer implements DataExternalizer<TimestampPerTarget[]> { - public void save(DataOutput out, TimestampPerTarget[] value) throws IOException { + public void save(@NotNull DataOutput out, TimestampPerTarget[] value) throws IOException { out.writeInt(value.length); for (TimestampPerTarget target : value) { out.writeInt(target.targetId); @@ -121,7 +121,7 @@ public class TimestampStorage extends AbstractStateStorage<File, TimestampStorag } } - public TimestampPerTarget[] read(DataInput in) throws IOException { + public TimestampPerTarget[] read(@NotNull DataInput in) throws IOException { int size = in.readInt(); TimestampPerTarget[] targets = new TimestampPerTarget[size]; for (int i = 0; i < size; i++) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java index d9c58323804b..450dea158675 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java +++ b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java @@ -16,11 +16,13 @@ package org.jetbrains.jps.javac; import com.intellij.openapi.util.SystemInfo; -import com.intellij.util.ExceptionUtil; import com.intellij.util.SmartList; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.api.CanceledStatus; +import org.jetbrains.jps.builders.impl.java.JavacCompilerTool; +import org.jetbrains.jps.builders.java.CannotCreateJavaCompilerException; +import org.jetbrains.jps.builders.java.JavaCompilingTool; import org.jetbrains.jps.builders.java.JavaSourceTransformer; import org.jetbrains.jps.cmdline.ClasspathBootstrap; import org.jetbrains.jps.incremental.LineOutputWriter; @@ -45,8 +47,7 @@ public class JavacMain { "-d", "-classpath", "-cp", "-bootclasspath" )); private static final Set<String> FILTERED_SINGLE_OPTIONS = new HashSet<String>(Arrays.<String>asList( - /*javac options*/ "-verbose", "-proc:only", "-implicit:class", "-implicit:none", "-Xprefer:newer", "-Xprefer:source", - /*eclipse options*/"-noExit" + /*javac options*/ "-verbose", "-proc:only", "-implicit:class", "-implicit:none", "-Xprefer:newer", "-Xprefer:source" )); public static boolean compile(Collection<String> options, @@ -57,52 +58,29 @@ public class JavacMain { Map<File, Set<File>> outputDirToRoots, final DiagnosticOutputConsumer diagnosticConsumer, final OutputFileConsumer outputSink, - CanceledStatus canceledStatus, boolean useEclipseCompiler) { - JavaCompiler compiler = null; - if (useEclipseCompiler) { - for (JavaCompiler javaCompiler : ServiceLoader.load(JavaCompiler.class)) { - compiler = javaCompiler; - break; - } - if (compiler == null) { - diagnosticConsumer.report(new PlainMessageDiagnostic(Diagnostic.Kind.ERROR, "Eclipse Batch Compiler was not found in classpath")); - return false; - } - } - - final boolean nowUsingJavac; - if (compiler == null) { - compiler = ToolProvider.getSystemJavaCompiler(); - if (compiler == null) { - String message = "System Java Compiler was not found in classpath"; - // trying to obtain additional diagnostic for the case when compiler.jar is present, but there were problems with compiler class loading: - try { - Class.forName("com.sun.tools.javac.api.JavacTool", false, JavacMain.class.getClassLoader()); - } - catch (Throwable ex) { - message = message + ":\n" + ExceptionUtil.getThrowableText(ex); - } - diagnosticConsumer.report(new PlainMessageDiagnostic(Diagnostic.Kind.ERROR, message)); - return false; - } - nowUsingJavac = true; + CanceledStatus canceledStatus, @NotNull JavaCompilingTool compilingTool) { + JavaCompiler compiler; + try { + compiler = compilingTool.createCompiler(); } - else { - nowUsingJavac = false; + catch (CannotCreateJavaCompilerException e) { + diagnosticConsumer.report(new PlainMessageDiagnostic(Diagnostic.Kind.ERROR, e.getMessage())); + return false; } for (File outputDir : outputDirToRoots.keySet()) { outputDir.mkdirs(); } - + final List<JavaSourceTransformer> transformers = getSourceTransformers(); - final JavacFileManager fileManager = new JavacFileManager(new ContextImpl(compiler, diagnosticConsumer, outputSink, canceledStatus, nowUsingJavac), transformers); + final boolean usingJavac = compilingTool instanceof JavacCompilerTool; + final JavacFileManager fileManager = new JavacFileManager(new ContextImpl(compiler, diagnosticConsumer, outputSink, canceledStatus, usingJavac), transformers); fileManager.handleOption("-bootclasspath", Collections.singleton("").iterator()); // this will clear cached stuff fileManager.handleOption("-extdirs", Collections.singleton("").iterator()); // this will clear cached stuff fileManager.handleOption("-endorseddirs", Collections.singleton("").iterator()); // this will clear cached stuff - final Collection<String> _options = prepareOptions(options, nowUsingJavac); + final Collection<String> _options = prepareOptions(options, compilingTool); try { fileManager.setOutputDirectories(outputDirToRoots); @@ -115,7 +93,7 @@ public class JavacMain { if (!classpath.isEmpty()) { try { fileManager.setLocation(StandardLocation.CLASS_PATH, classpath); - if (!nowUsingJavac && !isOptionSet(options, "-processorpath")) { + if (!usingJavac && !isOptionSet(options, "-processorpath")) { // for non-javac file manager ensure annotation processor path defaults to classpath fileManager.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpath); } @@ -148,7 +126,7 @@ public class JavacMain { //noinspection IOResourceOpenedButNotSafelyClosed final LineOutputWriter out = new LineOutputWriter() { protected void lineAvailable(String line) { - if (nowUsingJavac) { + if (usingJavac) { diagnosticConsumer.outputLineAvailable(line); } else { @@ -169,6 +147,7 @@ public class JavacMain { final JavaCompiler.CompilationTask task = compiler.getTask( out, fileManager, diagnosticConsumer, _options, null, fileManager.getJavaFileObjectsFromFiles(sources) ); + compilingTool.prepareCompilationTask(task, _options); //if (!IS_VM_6_VERSION) { //todo! // // Do not add the processor for JDK 1.6 because of the bugs in javac @@ -186,7 +165,7 @@ public class JavacMain { } finally { fileManager.close(); - if (nowUsingJavac) { + if (usingJavac) { cleanupJavacNameTable(); } } @@ -221,14 +200,9 @@ public class JavacMain { return false; } - private static Collection<String> prepareOptions(final Collection<String> options, boolean usingJavac) { + private static Collection<String> prepareOptions(final Collection<String> options, @NotNull JavaCompilingTool compilingTool) { final List<String> result = new ArrayList<String>(); - if (usingJavac) { - result.add("-implicit:class"); // the option supported by javac only - } - else { // is Eclipse - result.add("-noExit"); - } + result.addAll(compilingTool.getDefaultCompilerOptions()); boolean skip = false; for (String option : options) { if (FILTERED_OPTIONS.contains(option)) { @@ -236,7 +210,7 @@ public class JavacMain { continue; } if (!skip) { - if (!FILTERED_SINGLE_OPTIONS.contains(option)) { + if (!FILTERED_SINGLE_OPTIONS.contains(option) && !compilingTool.getDefaultCompilerOptions().contains(option)) { result.add(option); } } diff --git a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServer.java b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServer.java index b5dc9bad44fb..65c92e2ae76f 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServer.java +++ b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServer.java @@ -29,6 +29,9 @@ import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender; import io.netty.util.concurrent.ImmediateEventExecutor; import org.jetbrains.annotations.NotNull; import org.jetbrains.jps.api.CanceledStatus; +import org.jetbrains.jps.builders.impl.java.JavacCompilerTool; +import org.jetbrains.jps.builders.java.JavaBuilderUtil; +import org.jetbrains.jps.builders.java.JavaCompilingTool; import org.jetbrains.jps.service.SharedThreadPool; import javax.tools.*; @@ -44,7 +47,7 @@ public class JavacServer { public static final int DEFAULT_SERVER_PORT = 7878; public static final String SERVER_SUCCESS_START_MESSAGE = "Javac server started successfully. Listening on port: "; public static final String SERVER_ERROR_START_MESSAGE = "Error starting Javac Server: "; - public static final String USE_ECLIPSE_COMPILER_PROPERTY = "use.eclipse.compiler"; + public static final String JPS_JAVA_COMPILING_TOOL_PROPERTY = "jps.java.compiling.tool"; private ChannelRegistrar myChannelRegistrar; @@ -153,7 +156,8 @@ public class JavacServer { }; try { - final boolean rc = JavacMain.compile(options, files, classpath, platformCp, sourcePath, outs, diagnostic, outputSink, canceledStatus, System.getProperty(USE_ECLIPSE_COMPILER_PROPERTY) != null); + JavaCompilingTool tool = getCompilingTool(); + final boolean rc = JavacMain.compile(options, files, classpath, platformCp, sourcePath, outs, diagnostic, outputSink, canceledStatus, tool); return JavacProtoUtil.toMessage(sessionId, JavacProtoUtil.createBuildCompletedResponse(rc)); } catch (Throwable e) { @@ -163,6 +167,17 @@ public class JavacServer { } } + private static JavaCompilingTool getCompilingTool() { + String property = System.getProperty(JPS_JAVA_COMPILING_TOOL_PROPERTY); + if (property != null) { + JavaCompilingTool tool = JavaBuilderUtil.findCompilingTool(property); + if (tool != null) { + return tool; + } + } + return new JavacCompilerTool(); + } + private final Set<CancelHandler> myCancelHandlers = Collections.synchronizedSet(new HashSet<CancelHandler>()); public void cancelBuilds() { diff --git a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerBootstrap.java b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerBootstrap.java index 40b646e9a8dc..bb66e9c6b09f 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerBootstrap.java +++ b/jps/jps-builders/src/org/jetbrains/jps/javac/JavacServerBootstrap.java @@ -25,6 +25,7 @@ import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.concurrency.Semaphore; +import org.jetbrains.jps.builders.java.JavaCompilingTool; import org.jetbrains.jps.cmdline.ClasspathBootstrap; import org.jetbrains.jps.service.SharedThreadPool; @@ -44,7 +45,7 @@ public class JavacServerBootstrap { int port, File workingDir, List<String> vmOptions, - boolean useEclipseCompiler) throws Exception { + JavaCompilingTool compilingTool) throws Exception { final List<String> cmdLine = new ArrayList<String>(); appendParam(cmdLine, getVMExecutablePath(sdkHomePath)); appendParam(cmdLine, "-XX:MaxPermSize=150m"); @@ -82,9 +83,7 @@ public class JavacServerBootstrap { appendParam(cmdLine, "-Duser.region=" + region); } - if (useEclipseCompiler) { - appendParam(cmdLine, "-D" + JavacServer.USE_ECLIPSE_COMPILER_PROPERTY); - } + appendParam(cmdLine, "-D" + JavacServer.JPS_JAVA_COMPILING_TOOL_PROPERTY + "=" + compilingTool.getId()); // this will disable standard extensions to ensure javac is loaded from the right tools.jar appendParam(cmdLine, "-Djava.ext.dirs="); @@ -95,7 +94,7 @@ public class JavacServerBootstrap { appendParam(cmdLine, "-classpath"); - final List<File> cp = ClasspathBootstrap.getJavacServerClasspath(sdkHomePath, useEclipseCompiler); + final List<File> cp = ClasspathBootstrap.getJavacServerClasspath(sdkHomePath, compilingTool); final StringBuilder classpath = new StringBuilder(); for (File file : cp) { if (classpath.length() > 0) { @@ -156,17 +155,15 @@ public class JavacServerBootstrap { public void onTextAvailable(ProcessEvent event, Key outputType) { if (outputType == ProcessOutputTypes.STDERR) { - try { - final String text = event.getText(); - if (text != null) { - if (text.contains(JavacServer.SERVER_SUCCESS_START_MESSAGE) || text.contains(JavacServer.SERVER_ERROR_START_MESSAGE)) { - processHandler.removeProcessListener(this); - serverStartMessage.set(text); - } + final String text = event.getText(); + if (text != null && (text.contains(JavacServer.SERVER_SUCCESS_START_MESSAGE) || text.contains(JavacServer.SERVER_ERROR_START_MESSAGE))) { + try { + processHandler.removeProcessListener(this); + serverStartMessage.set(text); + } + finally { + semaphore.up(); } - } - finally { - semaphore.up(); } } } diff --git a/jps/model-impl/jps-model-impl.iml b/jps/model-impl/jps-model-impl.iml index 5e72944c0f30..447c25cc7583 100644 --- a/jps/model-impl/jps-model-impl.iml +++ b/jps/model-impl/jps-model-impl.iml @@ -4,13 +4,11 @@ <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="jps-model-api" /> - <orderEntry type="module" module-name="testFramework" scope="TEST" /> </component> </module> diff --git a/jps/model-impl/jps-model-tests.iml b/jps/model-impl/jps-model-tests.iml new file mode 100644 index 000000000000..f42308922277 --- /dev/null +++ b/jps/model-impl/jps-model-tests.iml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/testSrc"> + <sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="jps-model-impl" /> + <orderEntry type="module" module-name="testFramework" exported="" scope="TEST" /> + </component> +</module> + diff --git a/jps/model-serialization/jps-model-serialization.iml b/jps/model-serialization/jps-model-serialization.iml index 988e3c506729..6859151b1bd5 100644 --- a/jps/model-serialization/jps-model-serialization.iml +++ b/jps/model-serialization/jps-model-serialization.iml @@ -4,15 +4,12 @@ <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="util" /> <orderEntry type="module" module-name="jps-model-api" /> <orderEntry type="library" exported="" name="JDOM" level="project" /> - <orderEntry type="module" module-name="jps-model-impl" exported="" scope="TEST" /> - <orderEntry type="module" module-name="testFramework" exported="" scope="TEST" /> </component> </module> diff --git a/jps/model-serialization/jps-serialization-tests.iml b/jps/model-serialization/jps-serialization-tests.iml new file mode 100644 index 000000000000..953fef28dd82 --- /dev/null +++ b/jps/model-serialization/jps-serialization-tests.iml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/testSrc"> + <sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="jps-model-serialization" /> + <orderEntry type="module" module-name="jps-model-tests" exported="" scope="TEST" /> + </component> +</module> + |