Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

How to include dlls added by NuGet package manager in a git repository November 26, 2010

Filed under: Git,Visual Studio — Rupert Bates @ 9:28 am

If you have excluded dll files from your git repository with your .gitignore file but DO want to include them when they have been added via the NuGet package manager, you can add this after the dll exclude.

# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll

 

How to add a project reference – an introduction to IntelliJ IDEA 9 for Visual Studio users October 9, 2010

Filed under: IntelliJ,Java,Visual Studio — Rupert Bates @ 1:19 pm

To add a reference to an external library (the equivalent of right clicking on project references and selecting ‘Add’ in VS):

  1. Goto Project structure dialog (File\Project structure or Ctrl+Alt+Shift+S)
  2. In the ‘Project settings’ pane select Modules
  3. Make sure your project is selected in the middle pane
  4. Click the dependencies tab in the right hand pane

You can now add and delete dependencies on libraries (equivalent to adding a project reference).

There are a number of different types of depency you can add, here they are with my best guesses at how they translate into Visual Studio terminology:

  1. Single entry module – a reference to a single jar file – same as adding a reference to a dll in VS
  2. Module library – a reference to a group of jar files (accessible only to this module?) – no real equivalent in VS
  3. Project library – a reference to a group of jar files (accessible to whole project?) – no real equivalent in VS
  4. Global library – a reference to a group of jar files (accessible to all projects?) – similar to adding a reference to a dll in the GAC
  5. Module dependency – a reference to another project – same as a project reference in VS
 

The .gitignore file I use with Visual Studio projects March 26, 2010

Filed under: Git,Visual Studio — Rupert Bates @ 7:48 pm

This seems to keep most of the crap out and I haven’t found anything necessary that it excludes yet.

# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo

# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll

# VS Upgrade stuff #
####################
UpgradeLog.XML
_UpgradeReport_Files/

# Directories #
###############
bin/
obj/
TestResults/

# Web publish log #
###################
*.Publish.xml

# Resharper #
#############
/_ReSharper.*
*.ReSharper.*

# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sqlite

# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db