typescript.java icon indicating copy to clipboard operation
typescript.java copied to clipboard

No compilation of typescript files after Cleaning / Rebuilding

Open ggruber4711 opened this issue 7 years ago • 4 comments

I noticed that compilation of *.ts files is basically done on save of a file and when you call "Run As => Compile Typescript" on the tsconfig.json file. However I would like to have also an automatic build, after Eclipse is either

  • refreshing the project
  • re-building the project after a clean This are 2 typical situations faced by Java/Web developers when working in a mixed Java/Web/Javascript project containing both java and javascript files.

Is there somehow a solution for this requirement? Thanks in advance!

ggruber4711 avatar May 05 '18 10:05 ggruber4711

Indeed, it should be implemented, I have started to do something but it's an hard task.

angelozerr avatar May 05 '18 10:05 angelozerr

There is a kind of workaround to get it implemented by adding an external Builder to your Eclipse project Configuration, which looks like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"> <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc}/.metadata/.plugins/ts.eclipse.ide.server.nodejs.embed.win32.win32.x86_64/node-v6.9.4-win-x64/node.exe"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,clean"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${workspace_loc}/.metadata/.plugins/ts.repository/repositories/2.4.1/node_modules/typescript/bin/tsc"/> <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/> </launchConfiguration>

The nasty thing about it, is that you have to hardcode the path to

  • nodejs
  • typescript compiler. But it works for me :-)

eclipse_typescriptcompilebuilder

ggruber4711 avatar May 05 '18 14:05 ggruber4711

Is there an eclipse variable reflecting the path to tsc and node?

ggruber4711 avatar May 05 '18 14:05 ggruber4711

@ggruber4711 it already exist a typescript builder but it doesn't support clean and build all. I have started to implement itl but I had a lot of problem with performance and I had some limitation with tsserver which doesn't support the compile when file is not opened. I must just find time to retyry it.

angelozerr avatar May 05 '18 17:05 angelozerr