My Blog has moved!

My Blog has moved, now all new blogs will be now on http://www.cwlabs.eu

Advertisements

1&1 Coding Dojo

Unter dem Motto Mocking hat die Münchner Coding Dojo Community ein 1&1 Coding Dojo veranstaltet.

Gemeinsam mit Ilker Cetinkaya (Moderator) und Jörg Wendland (1&1) haben wir einen schönen Coding Abend verbracht.

Ich freue mich sehr, dass ich als Abschied von der 1&1 noch dieses Dojo organizieren und veranstalten durfte.

Hier noch der Orginal Text aus der Xing Einladung 😉

Hallo Freunde der Code-Kunst,

Im September geht es wieder weiter mit einem interessanten Coding Dojo bei 1&1 in München.

Das Thema ist: “Mocking”. Wir werden unser Dojo mehrheitlich in web- und objektorientierten Sprachen umsetzen, wie z.B. JavaScript, Python, C# oder Java. Der Fokus liegt hierbei auf Spying, Stubbing, Mocking und Faking.

Frei nach den “originalen” Coding Dojo’s legen wir bei diesem Zusammentreffen, bei dem wir eine kleine, aber herausfordernde Programmieraufgabe (Code Kata) lösen möchten, wieder Wert auf
-> Gleichstellung aller Teilnehmer
-> Aktivität im Dojo
-> Respektvollen Umgang
-> Optimistische Herangehensweise
-> Zwanglose, lockere Atmosphäre

Das Ziel & Ergebnis ist wie immer beim Dojo “Lernen & Lehren” mit Spaß!

Continuous Integration Script for Windows 8 Store Apps (PowerShell)

Nowadays it’s common to build Applications automatically. I made an application for one of the leading telecommunication companies in Germany and there it is necessary to make ci so I had to make a script which can build and deliver always an testable App.


$fileVersion = "C:\Build\Version.txt"
$AppPath = "C:\Projects 45\MySolution\"
$AppSolution = "MySolution.sln"
$msbuild = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
$buildfolder = "C:\StoreBuild"
$logger = "build.log"
$buildconfiguration = "Release"
$buildPath = "C:\Build\"

#Version Auslesen und erhöhen
$versionInfo = Get-content $fileVersion
$firstPoint = $versionInfo.IndexOf(".")
$versionMajorText = $versionInfo.Substring(0, $firstPoint)
$versionInfo = $versionInfo.Remove(0, $firstPoint+1)

$firstPoint = $versionInfo.IndexOf(".")
$versionMinorText = $versionInfo.Substring(0, $firstPoint)
$versionInfo = $versionInfo.Remove(0, $firstPoint+1)

$firstPoint = $versionInfo.IndexOf(".")
$versionBuildText = $versionInfo.Substring(0, $firstPoint)
$versionInfo = $versionInfo.Remove(0, $firstPoint+1)

$firstPoint = $versionInfo.IndexOf(".")
$versionRevisionText = $versionInfo

[int]$versionMajor = [System.Convert]::ToInt32($versionMajorText)
[int]$versionMinor = [System.Convert]::ToInt32($versionMinorText)
[int]$versionBuild = [System.Convert]::ToInt32($versionBuildText)
[int]$versionRevision = [System.Convert]::ToInt32($versionRevisionText)

$versionRevision++

[String]$versionText = [String]$versionMajor +"."+ [String]$versionMinor +"." + [String]$versionBuild + "." + [String]$versionRevision

Set-Content $fileVersion $versionText

$outputFolder = $buildPath + "Output\" + $versionText +"\"

#Konfigurationsdatei auslesen um die Manifestdateien zu ermitteln
$AppPathSolution = $AppPath + $AppSolution
$Solution = [String] (Get-Content -Path $AppPathSolution)
$Solution = $Solution.Substring(0, $Solution.IndexOf("EndProject Global")+11)
$Solution = $Solution.Substring($Solution.IndexOf("Project"))

echo "Update Version in Manifest files"
do
{
$endProjectIndex = $Solution.IndexOf("EndProject")
$ProjectItem = $Solution.Substring(0, $endProjectIndex +11)
$firstSeperator = $ProjectItem.IndexOf(",")
$lastSeperator = $ProjectItem.LastIndexOf(",")
$ProjectFile = $projectItem.Substring($firstSeperator + 2, $lastSeperator - $firstSeperator -2)
$Solution = $Solution.Remove(0, $endProjectIndex+11)
If ($ProjectFile.Contains("csproj"))
{
$ValidProject = $ProjectFile
$SearchPath = $AppPath + $ProjectFile.Substring(1, $ProjectFile.LastIndexOf("\"))
Foreach ($file in Get-Childitem $SearchPath)
{

If ($file.Name -eq "Package.appxmanifest")
{
echo $file.FullName
#Version in den Mainfestdateien Updaten
$Manifest = [xml] (Get-Content -Path $file.FullName)
$Manifest.Package.Identity.Version = $versionText
$Manifest.Save($file.FullName)
}
}
}
}
while($Solution.Length -gt 0)

echo "Files will be stored to: $buildfolder"

# if the build folder exists, delete it
if ([System.IO.Directory]::Exists($buildfolder))
{
[System.IO.Directory]::Delete($buildfolder, 1)
}

[System.IO.Directory]::CreateDirectory($buildfolder)

if ([System.IO.Directory]::Exists($buildfolder))
{
Copy-Item $AppPath* $buildfolder -recurse
}
else
{
[System.IO.Directory]::CreateDirectory($buildfolder)
Copy-Item $AppPath* $buildfolder -recurse

}

$options = ""
$options = $options + "/property:Configuration=" + $buildconfiguration
$options = $options + " /fl /flp:logfile=" + $buildfolder +"\" + $logger + " /noconsolelogger"
# create the build command and invoke it
# note that if you want to debug, remove the "/noconsolelogger"
# from the $options string
$build = $msbuild + " """ + $buildfolder +"\"+ $AppSolution + """ " + $options + " /t:Build"

echo "Build Process starting: $build"

Invoke-Expression $build

# move all the files that were built to the output folder
echo "Move Items from: $buildfolder"

$releaseFolderBrand1 = $buildfolder + "\Brand1\AppPackages\*"
$releaseFolderBrand2 = $buildfolder + "\Brand2\AppPackages\*"
$releaseFolderBrand1QA = $buildfolder + "\Brand1QA\AppPackages\*"
$releaseFolderBrand2QA = $buildfolder + "\Brand2QA\AppPackages\*"
$releaseFolderBrand1PRE = $buildfolder + "\Brand1PRE\AppPackages\*"
$releaseFolderBrand2PRE = $buildfolder + "\Brand2PRE\AppPackages\*"

$outputFolderBrand1 = $outputfolder + "Brand1\"
$outputFolderBrand2 = $outputfolder + "Brand2\"
$outputFolderBrand1QA = $outputfolder + "Brand1QA\"
$outputFolderBrand2QA = $outputfolder + "Brand2QA\"
$outputFolderBrand1PRE = $outputfolder + "Brand1PRE\"
$outputFolderBrand2PRE = $outputfolder + "Brand2PRE\"

[System.IO.Directory]::CreateDirectory($outputFolderBrand1)
[System.IO.Directory]::CreateDirectory($outputFolderBrand2)
[System.IO.Directory]::CreateDirectory($outputFolderBrand1QA)
[System.IO.Directory]::CreateDirectory($outputFolderBrand2QA)
[System.IO.Directory]::CreateDirectory($outputFolderBrand1PRE)
[System.IO.Directory]::CreateDirectory($outputFolderBrand2PRE)

Move-Item -Path $releaseFolderBrand1 -Destination $outputFolderBrand1 -Force
Move-Item -Path $releaseFolderBrand2 -Destination $outputFolderBrand2 -Force
Move-Item -Path $releaseFolderBrand1QA -Destination $outputFolderBrand1QA -Force
Move-Item -Path $releaseFolderBrand2QA -Destination $outputFolderBrand2QA -Force
Move-Item -Path $releaseFolderBrand1PRE -Destination $outputFolderBrand1PRE -Force
Move-Item -Path $releaseFolderBrand2PRE -Destination $outputFolderBrand2PRE -Force

Next is now that all builded packages must pass the AppCertificationKit.

Windows 8 Fundamentals Part 1

Based on my work on one of the largest web email Provider in Germany i build some lessons to teach the Windows Team the fundamentals for building Windows 8 Store Apps.

Part1 of this Lessons showes the differences between Windows 8 Store App Projects and common Windows 8 Desktop Applications based on .NET Framework 4.5