Everlaw / nbts

NetBeans TypeScript editor plugin
282 stars 46 forks source link

Can't build the sources #116

Open Chris2011 opened 6 years ago

Chris2011 commented 6 years ago

Hey,

I can’t build the source of NBTS. I downloaded the TypeScript sources from: https://github.com/Microsoft/TypeScript. And I changed the path in the build.xml to the typescript sources and after hit „run“ I got this error:

C:\Projekte\Netbeans Plugins\nbts\build.xml:48: 
java.io.IOException: Cannot run program "patch" (in directory "C:\Projekte\Netbeans Plugins\nbts\server\ts"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden

So it seemed, that I needed a patch command, I installed it from GnuWin32 and set it to my PATH variable (I have Windows 10), but this doesn’t work out for me. Can you help here?

Regards

Chris

jeffrey-easyesi commented 6 years ago

If you can run patch from the command line, try running ant copy-ts from the command line in the nbts directory.

Chris2011 commented 6 years ago

For what is the patch for? In general I don't have patch on windows. I installed it from GNU and I can call patch via cmd but it does nothing. And the build failed with this error:

C:\Projekte\Netbeans Plugins\nbts>ant copy-ts
Buildfile: C:\Projekte\Netbeans Plugins\nbts\build.xml

copy-ts.check:

copy-ts:
   [delete] Deleting directory C:\Projekte\Netbeans Plugins\nbts\server\ts
     [copy] Copying 94 files to C:\Projekte\Netbeans Plugins\nbts\server\ts
    [patch] patching file compiler/checker.ts
    [patch] Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
    [patch]
    [patch] This application has requested the Runtime to terminate it in an unusual way.
    [patch] Please contact the application's support team for more information.

BUILD FAILED
C:\Projekte\Netbeans Plugins\nbts\build.xml:48: 'patch' failed with exit code 3

Total time: 4 seconds
Chris2011 commented 6 years ago

I really would like to contribute, but I can't because of that, what I mentioned.

jeffrey-easyesi commented 6 years ago

The patches add some additional functionality to the language service. If you can't get patch working, you could always just comment out the <patch .../> element in build.xml, and apply the patches in server/ts manually.

Chris2011 commented 6 years ago

Ok, will try to use it w/o patch, will only add some templates. Please see the PR which are still open.

Chris2011 commented 6 years ago

The one with the templates is interesting.

Chris2011 commented 6 years ago

Or add us as contributors please.

Chris2011 commented 6 years ago

@jeffrey-easyesi I downloaded the sources for TypeScript and added the path to the build.xml but I got this error:

C:\Projekte\Netbeans Plugins\nbts\build.xml:50: Execute failed: java.io.IOException: Cannot run program "C:\Projekte\Others\TypeScript\bin\tsc" (in directory "C:\Projekte\Netbeans Plugins\nbts"): CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung Of course it is correct, but I thought tsc will open with node, and when I try this in my command line: node C:\Projekte\Others\TypeScript\bin\tsc then I got the help section.

So the build script will not start the node before it calls the tsc. Did I download the wrong code for TypeScript? I got it from here: https://github.com/Microsoft/TypeScript.

Again, I'm a windows user.

Chris2011 commented 6 years ago

Ok I got it working, I changed the tsc to tsc.cmd. But now I got this problem:

Building nbts-services.js
server/main.ts(319,57): error TS2339: Property 'length' does not exist on type '__String'.
  Property 'length' does not exist on type 'void & { __escapedIdentifier: void; }'.
server/main.ts(470,88): error TS2345: Argument of type '__String' is not assignable to parameter of type 'string'.
  Type 'void & { __escapedIdentifier: void; }' is not assignable to type 'string'.
C:\Projekte\Netbeans Plugins\nbts\build.xml:74: exec returned: 1
BUILD FAILED (total time: 26 seconds)
Chris2011 commented 6 years ago

At line 319, we have this: node.text && highlight(node.end - node.text.length, node.end, attr);

Chris2011 commented 5 years ago

Can anyone help here out? I want to contribute to this project, but I can't because it is not building. @geekdenz @jeffrey-easyesi @jamie-everlaw

geekdenz commented 5 years ago

@Chris2011 Maybe try a stable or even older (stable) version of TypeScript like a release or earlier tagged version. Not sure which tag it is, but if there is a patch, you need a specific version that the patch was written for. Might be in the meta data of the patch, although, tbh I don't know the exact algorithm patch uses. Generally, one shouldn't get caught up in wanting the latest all the time. Sometimes stability or even an earlier version with less features can be better for one's purpouses.

Chris2011 commented 5 years ago

@Chris2011 Maybe try a stable or even older (stable) version of TypeScript like a release or earlier tagged version. Not sure which tag it is, but if there is a patch, you need a specific version that the patch was written for. Might be in the meta data of the patch, although, tbh I don't know the exact algorithm patch uses. Generally, one shouldn't get caught up in wanting the latest all the time. Sometimes stability or even an earlier version with less features can be better for one's purpouses.

Thx will have a look.

Chris2011 commented 5 years ago

@jeffrey-easyesi which exact version did you use?

jeffrey-easyesi commented 5 years ago

@Chris2011 Everything about the build process is in build.xml.

Chris2011 commented 5 years ago

Thx for the help....not. When everything would be clear, I wouldn't ask for help.

Chris2011 commented 5 years ago

And I think you only did this under linux w/o any problems. I use windows.