-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cygwin support #1
Comments
The regular expression stuff seems like a Python 2 vs Python 3 thing. I'll take a look. Not sure there's much I can do about the cygwin errors. I'm just using normal |
I'm actually using Python 3.2.3. |
I tried to code Python 3 style but have been running on Python 2 locally. I think the result of the call to regex just needs a |
f291c08 fixes the bytes problem on Python 3 but the folders are empty so I'll have to dig more. |
I've tried again on a clean Ubuntu VM with python, python2, python3 and they all remains silent... I may do something wrong but I can't figure it out. |
@SimonMarquis Yes, it works very well with Cygwin, I've tested 😄, but you must perform some changes. You need download "diffutils" Cygwin's package for enable "diff" command in Windows because "diff" is typical of UNIX systems. Make sure that Cygwin is in your PATH. Now, the next change is in code. Look at https://github.com/JakeWharton/jardiff/blob/master/jardiff.py#L37, it works perfectly in UNIX systems, but in Windows, you must invoke "javap" differently. |
@SimonMarquis In Windows, you may use the following command "javap -public -classpath [here, enter the base path of the *.class files contained in the *.jar file] [class without *.class extension]" |
@SimonMarquis @JakeWharton Testing the solution above with Square's Retrofit: After extracting the *.class files contained in the retrofit.jar, it happens before _javap_public(files) method call, you should have this file tree: Inside the folder "retrofit" you will see something like this: Now, we are able to call correctly "javap" command-line. Try use this command: "javap -public -classpath C:\Users\HoracioCavalcanti\AppData\Local\Temp\tmp09qay1 retrofit.Callback" for one class and "javap -public -classpath C:\Users\HoracioCavalcanti\A The problem seemingly is resolved 😄 😸, since "diffutils" Cygwin's package x86 or x64 versions is installed, all the code will work correctly 😄 |
@HoracioFilho It's working manually, but I don't figure out how to process it automatically with the script. Here with Windows cmd it finishes silently without doing nothing. And with cygwin cmd, it doesn't find the .class files. |
@SimonMarquis After solved the problem with the invocation of "javap". I found the last problem that is with regex expression. Look at: The problem is here https://github.com/JakeWharton/jardiff/blob/master/jardiff.py#L42, Windows uses different line separator. Unix's line separator is "\n" The regex expression always fails, because of that you find the folder empty. |
It's awsome ! Really, you did a great job. 👍 It seems that take the relative file path of the wrong argument... On the
By doing this, I was able to not get the Now, the script run smoothly, but it won't spit anything out :) It remains silent. I will try to investigate why. Update: It seems that the generated folders are simply empty... so diff is correct. Update 2: The |
@SimonMarquis Thanks a lot, God is wonderful and helps us a lot, I am very grateful to you for the opportunity to help you. I found one mistake with the code, I'll fix it when I come back to home 😄 |
@SimonMarquis What is your JDK version? Running on what operation system? 😄 |
@SimonMarquis Please, try the last version 😃 |
My JDK is
Despite the |
Hi @SimonMarquis The result is a little weird, here the script is running well on both Windows 8.1 and Ubuntu 14.04. Could you send me the files that have you used for testing the script? I would want to test they 😄 My email is [email protected] 😄 |
What is your Python version? 2.7.8 and 3.4.3 versions are more stable 😃 |
For both tests I'm using tape When using cygwin; The app finishes silently...
And the When using Windows cmd line: It only warns me with lot of:
The
And the |
@SimonMarquis I'll investigate it 😄 Sorry for the delay |
I think I finally found the issue with cygwin: Temporary folders created by The simplest workaround I found is to unzip under the same directory of the script: def _unzip(name):
destination = tempfile.mkdtemp(dir=os.path.dirname(os.path.realpath(__file__)))
with zipfile.ZipFile(name) as f:
f.extractall(destination)
return destination I've also discovered (runing the script on my own library) that jar must be construct with file compiled with the Here is the result: https://github.com/SimonMarquis/jardiff/compare/JakeWharton:master...master |
Hi Jake,
I'm trying to use this tool with a cygwin instance (on Windows).
I'm able to run the command, but the process fails when it searches for classes on temporary folders.
When I try it on the regular Windows cmd prompt, it fails in a different way:
Is there a way to run it on a Windows environment?
(diff and javap are available on both terminals)
The text was updated successfully, but these errors were encountered: