Author: scotte
Date: 2006-06-16 12:21:59 -0400 (Fri, 16 Jun 2006)
New Revision: 61804
Added:
trunk/monodevelop/Extras/MonoDevelop.Autotools/TarballTargetEditorWidget.cs
Modified:
trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog
trunk/monodevelop/Extras/MonoDevelop.Autotools/Handler.cs
trunk/monodevelop/Extras/MonoDevelop.Autotools/Makefile.am
trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionDeployer.cs
Log:
2006-06-16 Scott Ellington <[EMAIL PROTECTED]>
* SolutionDeployer.cs: Deploy and GenerateFiles can now
take a configuration parameter
* Makefile.am: added new file.
* TarballTargetEditorWidget.cs:
* Handler.cs:
Add option to set a default configuration at deployment.
Modified: trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog 2006-06-16
16:01:54 UTC (rev 61803)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/ChangeLog 2006-06-16
16:21:59 UTC (rev 61804)
@@ -1,3 +1,12 @@
+2006-06-16 Scott Ellington <[EMAIL PROTECTED]>
+
+ * SolutionDeployer.cs: Deploy and GenerateFiles can now
+ take a configuration parameter
+ * Makefile.am: added new file.
+ * TarballTargetEditorWidget.cs:
+ * Handler.cs:
+ Add option to set a default configuration at deployment.
+
2006-06-15 Scott Ellington <[EMAIL PROTECTED]>
* SolutionDeployer.cs: always run autogen.sh on Deploy
Modified: trunk/monodevelop/Extras/MonoDevelop.Autotools/Handler.cs
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/Handler.cs 2006-06-16
16:01:54 UTC (rev 61803)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/Handler.cs 2006-06-16
16:21:59 UTC (rev 61804)
@@ -36,7 +36,9 @@
public DeployTarget CreateTarget (CombineEntry entry)
{
- return new TarballDeployTarget (Id);
+ TarballDeployTarget target = new TarballDeployTarget
(Id);
+ target.TargetCombine = entry as Combine;
+ return target;
}
}
@@ -45,6 +47,11 @@
[ItemProperty ("TargetDirectory")]
string targetDir;
+ [ItemProperty ("DefaultConfiguration")]
+ string defaultConfig;
+
+ Combine target_combine;
+
public TarballDeployTarget ()
{
}
@@ -57,19 +64,33 @@
{
Combine combine = entry as Combine;
SolutionDeployer deployer = new SolutionDeployer ();
- deployer.Deploy ( combine, targetDir, monitor );
+ if ( defaultConfig == null || defaultConfig == "" )
+ deployer.Deploy ( combine, targetDir, monitor );
+ else deployer.Deploy ( combine, defaultConfig,
targetDir, monitor );
}
public override void CopyFrom (DeployTarget other)
{
base.CopyFrom (other);
- targetDir = ((TarballDeployTarget)other).targetDir;
+ TarballDeployTarget target = other as
TarballDeployTarget;
+ targetDir = target.targetDir;
+ defaultConfig = target.defaultConfig;
}
public string TargetDir {
get { return targetDir; }
set { targetDir = value; }
}
+
+ public string DefaultConfiguration {
+ get { return defaultConfig; }
+ set { defaultConfig = value; }
+ }
+
+ public Combine TargetCombine {
+ get { return target_combine; }
+ set { target_combine = value; }
+ }
}
public class TarballTargetEditor: IDeployTargetEditor
@@ -84,26 +105,4 @@
return new TarballTargetEditorWidget
((TarballDeployTarget) target);
}
}
-
- public class TarballTargetEditorWidget: Gtk.HBox
- {
- public TarballTargetEditorWidget (TarballDeployTarget target)
- {
- Gtk.Label lab = new Gtk.Label ("Deploy directory:");
- PackStart (lab, false, false, 0);
-
- Gnome.FileEntry fe = new Gnome.FileEntry
("tarball-folders","Target Directory");
- fe.GtkEntry.Text = target.TargetDir;
- fe.Directory = true;
- fe.Modal = true;
- fe.UseFilechooser = true;
- fe.FilechooserAction =
Gtk.FileChooserAction.SelectFolder;
- fe.GtkEntry.Changed += delegate (object s, EventArgs
args) {
- target.TargetDir = fe.GtkEntry.Text;
- };
-
- PackStart (fe, true, true, 6);
- ShowAll ();
- }
- }
}
Modified: trunk/monodevelop/Extras/MonoDevelop.Autotools/Makefile.am
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/Makefile.am 2006-06-16
16:01:54 UTC (rev 61803)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/Makefile.am 2006-06-16
16:21:59 UTC (rev 61804)
@@ -25,6 +25,7 @@
SimpleProjectMakefileHandler.cs \
SolutionDeployer.cs \
SolutionMakefileHandler.cs \
+ TarballTargetEditorWidget.cs \
TemplateEngine.cs
RES =
Modified: trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionDeployer.cs
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionDeployer.cs
2006-06-16 16:01:54 UTC (rev 61803)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/SolutionDeployer.cs
2006-06-16 16:21:59 UTC (rev 61804)
@@ -57,6 +57,11 @@
public bool GenerateFiles (Combine combine, IProgressMonitor
monitor )
{
+ return GenerateFiles ( combine,
combine.ActiveConfiguration.Name, monitor );
+ }
+
+ public bool GenerateFiles (Combine combine, string defaultConf,
IProgressMonitor monitor )
+ {
monitor.BeginTask ( GettextCatalog.GetString
("Generating Autotools files for Solution {0}", combine.Name), 1 );
try
@@ -78,7 +83,7 @@
context.AddAutoconfFile ( path );
CreateAutoGenDotSH ( monitor );
- CreateConfigureDotAC ( combine, monitor );
+ CreateConfigureDotAC ( combine, defaultConf,
monitor );
CreateMakefileInclude ( monitor );
AddTopLevelMakefileVars ( makefile, monitor );
@@ -105,8 +110,12 @@
public void Deploy ( Combine combine, string targetDir,
IProgressMonitor monitor )
{
- if ( !HasGeneratedFiles (combine) )
- if ( !GenerateFiles ( combine, monitor ) )
return;
+ Deploy ( combine, combine.ActiveConfiguration.Name,
targetDir, monitor );
+ }
+
+ public void Deploy ( Combine combine, string defaultConf,
string targetDir, IProgressMonitor monitor )
+ {
+ if ( !GenerateFiles ( combine, defaultConf, monitor ) )
return;
monitor.BeginTask ( GettextCatalog.GetString(
"Deploying Solution to Tarball" ) , 3 );
try
@@ -230,7 +239,7 @@
Syscall.chmod ( fileName , FilePermissions.S_IXOTH |
FilePermissions.S_IROTH | FilePermissions.S_IRWXU | FilePermissions.S_IRWXG );
}
- void CreateConfigureDotAC ( Combine combine, IProgressMonitor
monitor )
+ void CreateConfigureDotAC ( Combine combine, string
defaultConf, IProgressMonitor monitor )
{
monitor.Log.WriteLine ( GettextCatalog.GetString
("Creating configure.ac") );
TemplateEngine templateEngine = new TemplateEngine();
@@ -252,7 +261,7 @@
}
config_options.Append ( "if test -z
\"$CONFIG_REQUESTED\" ; then\n" );
config_options.AppendFormat ( "AM_CONDITIONAL({0},
true)\nfi\n", "ENABLE_"
- +
combine.ActiveConfiguration.Name.ToUpper() );
+ + defaultConf.ToUpper() );
templateEngine.Variables ["CONFIG_OPTIONS"] =
config_options.ToString();
Added:
trunk/monodevelop/Extras/MonoDevelop.Autotools/TarballTargetEditorWidget.cs
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Autotools/TarballTargetEditorWidget.cs
2006-06-16 16:01:54 UTC (rev 61803)
+++ trunk/monodevelop/Extras/MonoDevelop.Autotools/TarballTargetEditorWidget.cs
2006-06-16 16:21:59 UTC (rev 61804)
@@ -0,0 +1,65 @@
+using System;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+
+using Gtk;
+
+namespace MonoDevelop.Autotools
+{
+ public class TarballTargetEditorWidget : VBox
+ {
+ public TarballTargetEditorWidget (TarballDeployTarget target)
+ {
+ HBox dir_entry = new HBox ();
+
+ Label lab = new Label ( GettextCatalog.GetString
("Deploy directory:") );
+ dir_entry.PackStart (lab, false, false, 0);
+
+ Gnome.FileEntry fe = new Gnome.FileEntry
("tarball-folders","Target Directory");
+ fe.GtkEntry.Text = target.TargetDir;
+ fe.Directory = true;
+ fe.Modal = true;
+ fe.UseFilechooser = true;
+ fe.FilechooserAction = FileChooserAction.SelectFolder;
+ fe.GtkEntry.Changed += delegate (object s, EventArgs
args) {
+ target.TargetDir = fe.GtkEntry.Text;
+ };
+ dir_entry.PackStart (fe, true, true, 6);
+
+ PackStart ( dir_entry , false, false, 0 );
+
+ HBox config_box = new HBox ();
+
+ Label conlab = new Label ( GettextCatalog.GetString
("Default configuration:") );
+ config_box.PackStart (conlab, false, false, 0);
+
+ string curr_conf;
+ if ( target.DefaultConfiguration == null ||
target.DefaultConfiguration == "" )
+ curr_conf =
target.TargetCombine.ActiveConfiguration.Name;
+ else curr_conf = target.DefaultConfiguration;
+
+ ComboBox configs = ComboBox.NewText ();
+ for ( int ii=0; ii <
target.TargetCombine.Configurations.Count; ii++ )
+ {
+ string cc = target.TargetCombine.Configurations
[ii].Name;
+ configs.AppendText ( cc );
+ if ( cc == curr_conf ) configs.Active = ii;
+ }
+ configs.Changed += delegate (object s, EventArgs args) {
+ target.DefaultConfiguration =
configs.ActiveText;
+ };
+ config_box.PackStart ( configs, true, true, 6 );
+
+ PackStart ( config_box, false, false, 6 );
+
+ Label warning = new Label ();
+ warning.LineWrap = true;
+ string msg = GettextCatalog.GetString ( "Note:
Deploying to a tarball will create a set of autotools files in the solution
directory. It will also overwrite any existing autotools files." );
+ warning.Markup = "<i>" + msg + "</i>" ;
+ PackStart ( warning, false, false, 6 );
+
+ ShowAll ();
+ }
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches