public void CanCompileAssemblies()
        {
            ScriptEngine engine = new ScriptEngine();

            // This should let it work on windows or mono/unix I hope
            string dataPath = Path.Combine("..", Path.Combine("..", @"src\ECM7.Migrator.Tests\Data"));

            Assembly asm = engine.Compile(dataPath);
            Assert.IsNotNull(asm);

            MigrationLoader loader = new MigrationLoader(null, false, asm);
            Assert.AreEqual(2, loader.LastVersion);

            Assert.AreEqual(2, MigrationLoader.GetMigrationInfoList(asm).Count);
        }
Example #2
0
        protected override void ExecuteTask()
        {
            if (! string.IsNullOrEmpty(Directory))
            {
                ScriptEngine engine = new ScriptEngine(Language, null);
                Execute(engine.Compile(Directory));
            }

            if (null != MigrationsAssembly)
            {
                Assembly asm = Assembly.LoadFrom(MigrationsAssembly.FullName);
                Execute(asm);
            }
        }
Example #3
0
        public override bool Execute()
        {
            if (! String.IsNullOrEmpty(Directory))
            {
                ScriptEngine engine = new ScriptEngine(Language, null);
                Execute(engine.Compile(Directory));
            }

            if (null != Migrations)
            {
                foreach (ITaskItem assembly in Migrations)
                {
                    Assembly asm = Assembly.LoadFrom(assembly.GetMetadata("FullPath"));
                    Execute(asm);
                }
            }

            return true;
        }