Skip to content

Fix documentation error, resolve problem with Ant build.xml#7

Closed
nwallace wants to merge 4 commits intoneowit:masterfrom
nwallace:master
Closed

Fix documentation error, resolve problem with Ant build.xml#7
nwallace wants to merge 4 commits intoneowit:masterfrom
nwallace:master

Conversation

@nwallace
Copy link
Copy Markdown
Contributor

@nwallace nwallace commented Mar 6, 2013

No description provided.

nwallace added 3 commits March 6, 2013 10:45
I am still wrestling with getting this installed, but I believe this is an error in the documentation.  There is no file ftdetect/apexcode.vim.  The file 'apexcode.vim' lives in the 'ftplugin' directory.  Changing these two lines of code allowed the plugin to load its scripts and run (although I'm still unable to successfully pull down my project files).
@nwallace
Copy link
Copy Markdown
Contributor Author

nwallace commented Mar 6, 2013

Hi Andrey,

I've been trying to install this plugin for the last couple of days. I'm new to Vim, so I don't know Vimscript, but I've done my best to try and understand how the pieces are connected. I still can't get the plugin to interact with my Salesforce org, but I'm working on it. In the meantime, I've made these two changes. I was unable to install the plugin before I changed the plugin runtime filename. That enabled me to load the scripts, and got me syntax highlighting, access to the plugin commands, and access to the help file within Vim.

However, after that I tried to follow your instructions to pull down my project from Salesforce, and I encountered an Ant error. My version of Ant doesn't tolerate undefined targets, so I removed the undefined default target.

I'm still unable to use the plugin. I cannot do :ApexRefreshProject with the sample class file. I'm investigating the cause of this issue, and if I find more problems in the plugin, I'll send another pull request.

Thanks for all the work on this! I'm excited to get it working.

@neowit
Copy link
Copy Markdown
Owner

neowit commented Mar 6, 2013

Nathan,
Thank you for the fixes.

I have merged the documentation update commit and need to give a closer look at the ant target issue. The inexistent target there is deliberate, to make sure that incorrect configuration does not cause random target to fire.

Out of interest - what is your current setup?

  • OS?
  • Vim Version?

What error do you get when try :ApexRefreshProject ?

With regards to the remove system-generated build.xml~ - I think that file only existed on your local machine, because it is not part of the repo. I am guessing your .vimrc does not have 'backupdir' option configured and vim uses current directory.

@nwallace
Copy link
Copy Markdown
Contributor Author

nwallace commented Mar 7, 2013

Andrey,

In that case, perhaps a better solution than deleting the default target would be to define an empty placeholder target that does nothing. This also solves the problem I was having on my system. I have made added a commit to this effect.

As for working out my error, I'm using Windows 7, Vim 7.3 (32-bit CLI version), Java 1.7.0, and Ant 1.8.4.
_vimrc:

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
behave mswin

filetype plugin on
syntax on

let &runtimepath=&runtimepath . ',C:\Users\my_username\Vim\force.com'
runtime ftdetect/vim-force.com.vim

if !exists("g:apex_backup_folder")
  let g:apex_backup_folder="C:\\temp\\apex\\backup"
endif
if !exists("g:apex_temp_folder")
  let g:apex_temp_folder="C:\\temp\\apex\\gvim-deployment"
endif
if !exists("g:apex_deployment_error_log")
  let g:apex_deployment_error_log="gvim-deployment-error.log"
endif
if !exists("g:apex_properties_folder")
  let g:apex_properties_folder="C:\\Users\\my_username\\Vim\\properties"
endif
let g:apex_binary_tee = "C:\\bin\\UnixUtils\\usr\\local\\wbin\\tee.exe"
let g:apex_binary_touch = "C:\\bin\\UnixUtils\\usr\\local\\wbin\\touch.exe"

" optional parameters
let g:apex_API_version = 27.0
let g:apex_pollWaitMillis = 1000
let g:apex_syntax_case_sensitive = 0

On my machine, this is how I have my directories set up:

C:\Users\my_username\Vim\force.com            <-- contains the plugin (clone of this git repo)
C:\Users\my_username\Vim\SITDev1              <-- my Apex project folder, at the moment contains a copy of the contents of A-ProjectTemplate (src dir and its contents)
C:\Users\my_username\Vim\force.com\properties <-- contains SITDev1.properties
C:\temp\apex\backup                           <-- was originally an empty directory, now contains "SITDev1\TIMESTAMP" directories (all empty)
C:\temp\apex\gvim-deployment                  <-- contains only gvim-deployment-error.log
C:\bin\UnixUtils\usr\local\wbin               <-- contains tee.exe & touch.exe

Here's a screenshot of the error I get when I run :ApexRefreshProject from A-Fake-Class.cls:
image

As you can see, the error indicates that a file cannot be found. Does it mean it can't find the properties file? Because there is a properties file called SITDev1.properties in the directory C:\Users\my_username\Vim\properties. That file looks this:

sf.username=my_sfdc_login_email@my_org.com
sf.password=my_password_with_security_token_appended
sf.serverurl=https://login.salesforce.com

(yes, it's a production login, even though I've been referring to the org as 'SITDev1').

Any ideas? Any tips on how I might be able to debug this (can I add echo statements to .vim files or anything like that?)?

P.S., thanks for the tip about setting backupdir!

@neowit
Copy link
Copy Markdown
Owner

neowit commented Mar 7, 2013

Nathan,

It's been a long while (and lots of plugin changes) since I last run this plugin on Windows so there is a good chance that it no longer works on windows out of the box.
Let me setup a test in my windows VM and I will get back to you.

@nwallace
Copy link
Copy Markdown
Contributor Author

nwallace commented Mar 7, 2013

I'm so sorry to pull you back to the darkness... I'm working sporadically myself, so I'll let you know if I figure anything out. Thanks for everything

@neowit
Copy link
Copy Markdown
Owner

neowit commented Mar 7, 2013

The reason why ant complained about "no-default-task" target is because it could not find actual retrieveSource target specified in the command line because some windows quirk with trailing path separator in one of the parameters passed to ant.
I have made an update and that made it work on my Win VM. No need to remove "no-default-task" from build.xml

Pull current plugin version and see if that makes any difference for you.

@nwallace
Copy link
Copy Markdown
Contributor Author

nwallace commented Mar 7, 2013

That's done it! Thank you very much. I was able to pull down my project, and update/deploy a file. Again, I greatly appreciate your help.

@nwallace nwallace closed this Mar 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants