Skip to content

Instantly share code, notes, and snippets.

@AngryAnt
Created June 7, 2011 19:29
Show Gist options
  • Save AngryAnt/1012958 to your computer and use it in GitHub Desktop.
Save AngryAnt/1012958 to your computer and use it in GitHub Desktop.
Example perl script for building .net assemblies for use in Unity.
#!/bin/usr/perl
use strict;
use File::Basename;
chdir (File::Spec->rel2abs (dirname($0)."/..")); # Modify for location of perl script
my $monoPath = "External/Mono/builds/monodistribution";
my @sourceDirs = (
"Path/To/Source/*.cs",
"Path/To/More/Source/*.cs"
);
my $targetAssemblyPath = "Path/To/AssetStoreTools.dll";
my $unityEnginePath = "Path/To/UnityEngine.dll";
my $unityEditorPath = "Path/To/UnityEditor.dll";
my $command = "$monoPath/bin/gmcs -d:DEBUG -debug+ -r:$unityEnginePath,$unityEditorPath -target:library -out:$targetAssemblyPath";
while (<@sourceDirs>)
{
$command .= " $_";
}
system ($command) or die ("Unable to run gmcs");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment