Compare commits
104 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
5da1a6efa0 | |
|
|
e532e485cb | |
|
|
c8c2a84ceb | |
|
|
9277793568 | |
|
|
b3f5305208 | |
|
|
f7e1e7797e | |
|
|
5ab8823237 | |
|
|
44a32011b8 | |
|
|
83abffdf33 | |
|
|
cad3af5a5f | |
|
|
c412b15416 | |
|
|
93a6c5d111 | |
|
|
b38b1e351a | |
|
|
707c091a8d | |
|
|
aa5da41bdd | |
|
|
e2ee11fe6f | |
|
|
78b05e7109 | |
|
|
0db2b0aa39 | |
|
|
896ffc7af6 | |
|
|
4309cedffb | |
|
|
3972439ba6 | |
|
|
68415f6313 | |
|
|
49158c43ca | |
|
|
98af62bec5 | |
|
|
f9912d3fbf | |
|
|
3ddc372634 | |
|
|
a052b1cfe3 | |
|
|
5e9c4614e1 | |
|
|
54ae0b6141 | |
|
|
b772326d82 | |
|
|
24b8dbf834 | |
|
|
d364c7cc94 | |
|
|
25b58a1548 | |
|
|
b87b0b5b37 | |
|
|
3d7a40dd23 | |
|
|
7043276c9c | |
|
|
73cd858826 | |
|
|
3f27f5d9ce | |
|
|
4feaa0992d | |
|
|
4939004dca | |
|
|
53edc99ad9 | |
|
|
31dc59ad10 | |
|
|
9fc5967c1d | |
|
|
95c1f34fc6 | |
|
|
3e66f2a8c2 | |
|
|
65cc154185 | |
|
|
0745de4f20 | |
|
|
a333991516 | |
|
|
b183e05da0 | |
|
|
cf255b7b1b | |
|
|
f46c5e0c78 | |
|
|
0c7be54d43 | |
|
|
a2b4c18d7f | |
|
|
6314447f26 | |
|
|
ed9836fc27 | |
|
|
c2f6338103 | |
|
|
7026f11a73 | |
|
|
2b15ca40fb | |
|
|
3d47ebcaad | |
|
|
018d02fc1f | |
|
|
e0322fa7e9 | |
|
|
35ee02c6d8 | |
|
|
826140a7eb | |
|
|
7c11a708f0 | |
|
|
e0e6ed61eb | |
|
|
6953034312 | |
|
|
aa0b3394ea | |
|
|
a27b3ff8b7 | |
|
|
6d947c7ccd | |
|
|
ca7f318949 | |
|
|
78c8568855 | |
|
|
00c5f0f03e | |
|
|
609ed72335 | |
|
|
f42e2fce3c | |
|
|
88b4de94c8 | |
|
|
9fd63b8bfa | |
|
|
8aa91598b5 | |
|
|
d7e11e39f5 | |
|
|
890a51af8a | |
|
|
2e1ec00ec7 | |
|
|
94aea27f50 | |
|
|
ee6442ecd0 | |
|
|
6354c67bc3 | |
|
|
98022322ad | |
|
|
3e048e6d74 | |
|
|
6c231fa905 | |
|
|
72556cfd8a | |
|
|
1486d80dee | |
|
|
ad05a6980f | |
|
|
7c7f786a76 | |
|
|
b7317e41b1 | |
|
|
895238017e | |
|
|
298e0a41bd | |
|
|
810ab396d7 | |
|
|
9d93d6ff49 | |
|
|
e9ce303a6c | |
|
|
bd26508185 | |
|
|
31e938809d | |
|
|
60901c462f | |
|
|
06ad5b4193 | |
|
|
c37ce3d64c | |
|
|
e40ca7a120 | |
|
|
4ae8ef30c7 | |
|
|
213e47c8a3 |
|
|
@ -7,26 +7,38 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotCompileApp", "NotCompile
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "Domain\Domain.csproj", "{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "Domain\Domain.csproj", "{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DroidApp", "DroidApp\DroidApp.csproj", "{10AA179F-818F-4E3F-947E-DE1C0C87BB76}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||||
Debug|iPhone = Debug|iPhone
|
Debug|iPhone = Debug|iPhone
|
||||||
Release|iPhone = Release|iPhone
|
Release|iPhone = Release|iPhone
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
{10AA179F-818F-4E3F-947E-DE1C0C87BB76}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhone.Build.0 = Debug|iPhone
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhone.ActiveCfg = Release|iPhone
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhone.Build.0 = Release|iPhone
|
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||||
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
{3DE4FDFA-1502-44CF-9B73-78B6D730C59F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhone.Build.0 = Debug|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|iPhone.ActiveCfg = Release|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|iPhone.Build.0 = Release|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|iPhone.Build.0 = Release|Any CPU
|
||||||
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
{BD5EC0A1-EDC9-4D90-BACF-AE54F26148C1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
|
@ -23,7 +23,8 @@
|
||||||
<MtouchLink>None</MtouchLink>
|
<MtouchLink>None</MtouchLink>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<MtouchDebug>true</MtouchDebug>
|
<MtouchDebug>true</MtouchDebug>
|
||||||
<MtouchI18n />
|
<MtouchI18n>
|
||||||
|
</MtouchI18n>
|
||||||
<MtouchArch>ARMv7</MtouchArch>
|
<MtouchArch>ARMv7</MtouchArch>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||||
|
|
@ -34,7 +35,7 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<MtouchLink>None</MtouchLink>
|
<MtouchLink>None</MtouchLink>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<CodesignProvision>MyProvisioningValue</CodesignProvision><CodesignKey>MyCodesignValue</CodesignKey></PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
|
|
@ -46,7 +47,8 @@
|
||||||
<MtouchDebug>true</MtouchDebug>
|
<MtouchDebug>true</MtouchDebug>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<CodesignKey>iPhone Developer</CodesignKey>
|
<CodesignKey>iPhone Developer</CodesignKey>
|
||||||
<IpaPackageName />
|
<IpaPackageName>
|
||||||
|
</IpaPackageName>
|
||||||
<CodesignProvision>F82B1481-F3D0-4CB5-AA6E-8B8D8E3A9DC1</CodesignProvision>
|
<CodesignProvision>F82B1481-F3D0-4CB5-AA6E-8B8D8E3A9DC1</CodesignProvision>
|
||||||
<BuildIpa>true</BuildIpa>
|
<BuildIpa>true</BuildIpa>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
@ -59,8 +61,10 @@
|
||||||
<CodesignKey>iPhone Developer: Рустам Заитов (CTL85FZX6K)</CodesignKey>
|
<CodesignKey>iPhone Developer: Рустам Заитов (CTL85FZX6K)</CodesignKey>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<CodesignProvision>8F606DAE-F9C9-4A19-8EFF-34B990D76C28</CodesignProvision>
|
<CodesignProvision>8F606DAE-F9C9-4A19-8EFF-34B990D76C28</CodesignProvision>
|
||||||
<IpaPackageName />
|
<IpaPackageName>
|
||||||
<MtouchI18n />
|
</IpaPackageName>
|
||||||
|
<MtouchI18n>
|
||||||
|
</MtouchI18n>
|
||||||
<MtouchArch>ARMv7</MtouchArch>
|
<MtouchArch>ARMv7</MtouchArch>
|
||||||
<BuildIpa>true</BuildIpa>
|
<BuildIpa>true</BuildIpa>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
@ -70,9 +74,6 @@
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="monotouch" />
|
<Reference Include="monotouch" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Resources\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
<None Include="Info.plist" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
@ -88,4 +89,13 @@
|
||||||
<Name>Domain</Name>
|
<Name>Domain</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Content\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Content\Icons\icon-iphone-staging.png" />
|
||||||
|
<BundleResource Include="Content\Icons\icon-iphone-staging%402x.png" />
|
||||||
|
<BundleResource Include="Content\Icons\icon-iphone.png" />
|
||||||
|
<BundleResource Include="Content\Icons\icon-iphone%402x.png" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -16,5 +16,10 @@
|
||||||
<string>com.touchin.buildscript</string>
|
<string>com.touchin.buildscript</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.0.0</string>
|
<string>0.0.0</string>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>Content/Icons/icon-iphone@2x</string>
|
||||||
|
<string>Content/Icons/icon-iphone</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
Any raw assets you want to be deployed with your application can be placed in
|
||||||
|
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||||
|
|
||||||
|
These files will be deployed with your package and will be accessible using Android's
|
||||||
|
AssetManager, like this:
|
||||||
|
|
||||||
|
public class ReadAsset : Activity
|
||||||
|
{
|
||||||
|
protected override void OnCreate (Bundle bundle)
|
||||||
|
{
|
||||||
|
base.OnCreate (bundle);
|
||||||
|
|
||||||
|
InputStream input = Assets.Open ("my_asset.txt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Additionally, some Android functions will automatically load asset files:
|
||||||
|
|
||||||
|
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>10.0.0</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{10AA179F-818F-4E3F-947E-DE1C0C87BB76}</ProjectGuid>
|
||||||
|
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>DroidApp</RootNamespace>
|
||||||
|
<AndroidApplication>True</AndroidApplication>
|
||||||
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||||
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
|
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
|
||||||
|
<AssemblyName>DroidApp</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.1</TargetFrameworkVersion>
|
||||||
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AndroidLinkMode>None</AndroidLinkMode>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="Mono.Android" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MainActivity.cs" />
|
||||||
|
<Compile Include="Resources\Resource.designer.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\AboutResources.txt" />
|
||||||
|
<None Include="Assets\AboutAssets.txt" />
|
||||||
|
<None Include="Properties\AndroidManifest.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AndroidResource Include="Resources\layout\Main.axml" />
|
||||||
|
<AndroidResource Include="Resources\values\Strings.xml" />
|
||||||
|
<AndroidResource Include="Resources\drawable\Icon.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
using System;
|
||||||
|
using Android.App;
|
||||||
|
using Android.Content;
|
||||||
|
using Android.Runtime;
|
||||||
|
using Android.Views;
|
||||||
|
using Android.Widget;
|
||||||
|
using Android.OS;
|
||||||
|
|
||||||
|
namespace DroidApp
|
||||||
|
{
|
||||||
|
[Activity(Label = "DroidApp", MainLauncher = true)]
|
||||||
|
public class MainActivity : Activity
|
||||||
|
{
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
protected override void OnCreate(Bundle bundle)
|
||||||
|
{
|
||||||
|
base.OnCreate(bundle);
|
||||||
|
|
||||||
|
// Set our view from the "main" layout resource
|
||||||
|
SetContentView(Resource.Layout.Main);
|
||||||
|
|
||||||
|
// Get our button from the layout resource,
|
||||||
|
// and attach an event to it
|
||||||
|
Button button = FindViewById<Button>(Resource.Id.myButton);
|
||||||
|
|
||||||
|
button.Click += delegate
|
||||||
|
{
|
||||||
|
button.Text = string.Format("{0} clicks!", count++);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="DroidApp.DroidApp">
|
||||||
|
<uses-sdk />
|
||||||
|
<application android:label="DroidApp">
|
||||||
|
</application>
|
||||||
|
</manifest>
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using Android.App;
|
||||||
|
|
||||||
|
// Information about this assembly is defined by the following attributes.
|
||||||
|
// Change them to the values specific to your project.
|
||||||
|
[assembly: AssemblyTitle("DroidApp")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("")]
|
||||||
|
[assembly: AssemblyCopyright("rzaitov")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||||
|
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||||
|
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||||
|
[assembly: AssemblyVersion("1.0.0")]
|
||||||
|
// The following attributes are used to specify the signing key for the assembly,
|
||||||
|
// if desired. See the Mono documentation for more information about signing.
|
||||||
|
//[assembly: AssemblyDelaySign(false)]
|
||||||
|
//[assembly: AssemblyKeyFile("")]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||||
|
in your application as resource files. Various Android APIs are designed to
|
||||||
|
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||||
|
directly.
|
||||||
|
|
||||||
|
For example, a sample Android app that contains a user interface layout (main.axml),
|
||||||
|
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||||
|
would keep its resources in the "Resources" directory of the application:
|
||||||
|
|
||||||
|
Resources/
|
||||||
|
drawable/
|
||||||
|
icon.png
|
||||||
|
|
||||||
|
layout/
|
||||||
|
main.axml
|
||||||
|
|
||||||
|
values/
|
||||||
|
strings.xml
|
||||||
|
|
||||||
|
In order to get the build system to recognize Android resources, set the build action to
|
||||||
|
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||||
|
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||||
|
the build system will package the resources for distribution and generate a class called "R"
|
||||||
|
(this is an Android convention) that contains the tokens for each one of the resources
|
||||||
|
included. For example, for the above Resources layout, this is what the R class would expose:
|
||||||
|
|
||||||
|
public class R {
|
||||||
|
public class drawable {
|
||||||
|
public const int icon = 0x123;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class layout {
|
||||||
|
public const int main = 0x456;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class strings {
|
||||||
|
public const int first_string = 0xabc;
|
||||||
|
public const int second_string = 0xbcd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
|
||||||
|
to reference the layout/main.axml file, or R.strings.first_string to reference the first
|
||||||
|
string in the dictionary file values/strings.xml.
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
#pragma warning disable 1591
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// <autogenerated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Mono Runtime Version: 4.0.30319.17020
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </autogenerated>
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
[assembly: Android.Runtime.ResourceDesignerAttribute("DroidApp.Resource", IsApplication=true)]
|
||||||
|
|
||||||
|
namespace DroidApp
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
|
||||||
|
public partial class Resource
|
||||||
|
{
|
||||||
|
|
||||||
|
static Resource()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UpdateIdValues()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
static Attribute()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Attribute()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Drawable
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f020000
|
||||||
|
public const int Icon = 2130837504;
|
||||||
|
|
||||||
|
static Drawable()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Drawable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Id
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f050000
|
||||||
|
public const int myButton = 2131034112;
|
||||||
|
|
||||||
|
static Id()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Id()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Layout
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f030000
|
||||||
|
public const int Main = 2130903040;
|
||||||
|
|
||||||
|
static Layout()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Layout()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class String
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f040001
|
||||||
|
public const int app_name = 2130968577;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f040000
|
||||||
|
public const int hello = 2130968576;
|
||||||
|
|
||||||
|
static String()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pragma warning restore 1591
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/myButton"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/hello"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="hello">Hello World, Click Me!</string>
|
||||||
|
<string name="app_name">DroidApp</string>
|
||||||
|
</resources>
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
Добавить символьную ссылку на скрипт сборки. Заменить <builder_path> на абсолютный путь к корню репозитория билд скрипта
|
||||||
|
sudo ln -s <builder_path>/scripts/TouchinBuild/taskRunner.py /usr/local/bin/tibuild
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Чтобы работала система сборки необходимо выполнить формальные шаги:
|
||||||
|
0. [iOS] Убедиться что в собираемом проекте выбор профиля обеспечения и сертификата производится автоматически.
|
||||||
|
Так следует сделать чтобы любой разработчик мог собрать проект, на билд сервере будут подставлены необоходимы значения автоматически
|
||||||
|
|
||||||
|
1. [iOS, Android] Убедиться что в названии проекта нет пробелов.
|
||||||
|
|
||||||
|
2. [iOS, Android] В корне репозитория создать папку scripts
|
||||||
|
mkdir scripts
|
||||||
|
|
||||||
|
3. [iOS] Положить в папку scripts профили обеспечения со следующими названиями
|
||||||
|
development.mobileprovision
|
||||||
|
distribution.mobileprovision
|
||||||
|
|
||||||
|
4. [iOS, Android] В папке scripts создать файл settings.txt
|
||||||
|
touch scripts/settings.txt
|
||||||
|
|
||||||
|
5. [iOS, Android] Скопировать содержимое примера scripts/common/setting.txt в свой файл settings.txt и переопределить все необходимые настройки
|
||||||
|
Стоит обратить внимание на комментации
|
||||||
|
# required – эти настройки необходимо задать, иначе ничего не будет работать
|
||||||
|
# dont change – это можно менять если есть четкое осознание того что происходит
|
||||||
|
|
||||||
|
6. [iOS, Android] вызвать скрипт, заменив параметры
|
||||||
|
на сервере. <builder_path> скорее всего это /BuildServer/Scripts
|
||||||
|
tibuild --settings=scripts/settings.txt build=%build.number% builder_path=<builder_path>
|
||||||
|
|
||||||
|
локально. path_to_local_direcotry – путь к папке вне репозитория проекта (чтобы ничего не потерлось) или добавить папку в настройку backup_ignore
|
||||||
|
tibuild --settings=scripts/settings.txt build=777 builder_path=<builder_path> publish_path=<path_to_local_direcotry>
|
||||||
|
|
||||||
|
Пояснение значения некоторых настроек:
|
||||||
|
publish_step_type – enum(development|distribution) – в зависимости от этого значения будет вызван один из следующих шагов
|
||||||
|
'ios publish development.txt' – копирование файла ipa в папку @publish_path/
|
||||||
|
'ios publish distribution.txt' - создание zip архива (app файла) и копирование его в папку @publish_path/
|
||||||
|
Это значение было введено чтобы поддерживать сборку с разными профилями обеспечения.
|
||||||
|
Типичный кейс. У нас 2 профайла:
|
||||||
|
development.mobileprovision – сборка для наших тестировщиков [publish_step_type=development]
|
||||||
|
distribution.mobileprovision – сборка для апстора [publish_step_type=distribution]
|
||||||
|
Расширенный кейс. У нас 3 профайла
|
||||||
|
development.mobileprovision – сборка для наших тестировщиков [publish_step_type=development]
|
||||||
|
customer.mobileprovision – сборка для тестировщиков заказчиков [publish_step_type=development]
|
||||||
|
distribution.mobileprovision – сборка для апстора [publish_step_type=distribution]
|
||||||
|
|
||||||
|
bundle_id – BundleId который будет подставлен в Info.Plist файл. Настройка нужна для поддержки сборки с разными профилями обсеспечеиня. Так например в профиле обеспечения предоставляемом заказчиком будет указан другой BunldeId, те не com.touchin.projectname
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
restore from backup
|
||||||
|
create backup
|
||||||
|
|
||||||
|
inside 'BuildSample/BuildSample.sln' remove 'CoolApp:NotCompileApp:Domain' project
|
||||||
|
|
||||||
|
inside 'BuildSample/DroidApp/DroidApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
|
||||||
|
|
||||||
|
inside 'BuildSample/DroidApp/Properties/AndroidManifest.xml' set android:versionCode to '17'
|
||||||
|
inside 'BuildSample/DroidApp/Properties/AndroidManifest.xml' set android:versionName to '1.2.3'
|
||||||
|
|
||||||
|
clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||||
|
sign android 'BuildSample/BuildSample.sln' for '{@sln_config_build}' project 'DroidApp'
|
||||||
|
|
||||||
|
create dirs 'Output/GooglePlay/Artifacts'
|
||||||
|
sh cp BuildSample/DroidApp/Output/*.apk Output/GooglePlay/Artifacts
|
||||||
|
sh cp -a BuildSample/DroidApp/Output/ Output/GooglePlay/
|
||||||
|
|
||||||
|
restore from backup
|
||||||
|
delete backup
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
restore from backup # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными)
|
restore from backup # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными)
|
||||||
create backup
|
create backup
|
||||||
|
|
||||||
inside 'BuildSample/BuildSample.sln' remove NotCompileApp project
|
sh echo 'Hello from setup.txt'
|
||||||
|
|
||||||
|
inside 'BuildSample/BuildSample.sln' remove 'NotCompileApp:DroidApp' project
|
||||||
|
|
||||||
inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
|
inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
|
||||||
|
inside 'BuildSample/BuildSample/CoolApp.csproj' set AssemblyName to '{@assembly_name}' for ''
|
||||||
|
|
||||||
inside 'BuildSample/BuildSample/Info.plist' set CFBundleVersion to '{@version}'
|
inside 'BuildSample/BuildSample/Info.plist' set CFBundleVersion to '{@version}'
|
||||||
inside 'BuildSample/BuildSample/Info.plist' set CFBundleDisplayName to 'CoolApp'
|
inside 'BuildSample/BuildSample/Info.plist' set CFBundleDisplayName to '{@project_name}'
|
||||||
|
|
||||||
|
inside 'BuildSample/BuildSample/Info.plist' set CFBundleIconFiles with values '{@icons}'
|
||||||
|
|
||||||
install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'
|
install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
sh echo hello from '{@author}'
|
<include 'scripts/{@setup_steps}'>
|
||||||
sh echo version: '{@version}'
|
|
||||||
|
|
||||||
<include 'scripts/IosSetupSteps.txt'>
|
|
||||||
|
|
||||||
clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||||
build 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
build 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||||
|
|
||||||
create dirs 'Output/Appstore/Artifacts'
|
create dirs 'Output/Appstore/Artifacts'
|
||||||
copy 'BuildSample/BuildSample/Output/BuildSample-{@version}.ipa' to 'Output/Appstore/Artifacts'
|
copy 'BuildSample/BuildSample/Output/{@assembly_name}-{@version}.ipa' to 'Output/Appstore/Artifacts'
|
||||||
sh cp -a BuildSample/BuildSample/Output/ Output/Appstore/
|
sh cp -a BuildSample/BuildSample/Output/ Output/Appstore/
|
||||||
|
|
||||||
publish 'Output/Appstore/Artifacts/BuildSample-{@version}.ipa' to testflight notes = 'Hello' api_token = '{@tf_api_token}' team_token = '{@tf_team_token}'
|
#publish 'Output/Appstore/Artifacts/{@assembly_name}-{@version}.ipa' to testflight notes = 'Hello' api_token = '{@tf_api_token}' team_token = '{@tf_team_token}'
|
||||||
|
|
||||||
restore from backup
|
restore from backup
|
||||||
delete backup
|
delete backup
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
from parsers.ValuesStriper import ValuesStripper
|
||||||
|
|
||||||
|
|
||||||
|
class BaseBackupCommandBuilder:
|
||||||
|
def __init__(self, ignoreBackupStr):
|
||||||
|
|
||||||
|
if ignoreBackupStr:
|
||||||
|
splitter = ValuesStripper(',')
|
||||||
|
values = splitter.strip(ignoreBackupStr)
|
||||||
|
self.ignoreBackup = values
|
||||||
|
else:
|
||||||
|
self.ignoreBackup = []
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
|
from CommandBuilders.BuilderBackupCommands.BaseBackupCommandBuilder import BaseBackupCommandBuilder
|
||||||
from commands.BaseBackupCommand.CreateBackupCommand import CreateBackupCommand
|
from commands.BaseBackupCommand.CreateBackupCommand import CreateBackupCommand
|
||||||
from parsers.ParserBackup.CreateBackupParser import CreateBackupParser
|
from parsers.ParserBackup.CreateBackupParser import CreateBackupParser
|
||||||
|
|
||||||
|
|
||||||
class CreateBackupCommandBuilder:
|
class CreateBackupCommandBuilder(BaseBackupCommandBuilder):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackupStr):
|
||||||
pass
|
BaseBackupCommandBuilder.__init__(self, ignoreBackupStr)
|
||||||
|
|
||||||
def isCreateBackup(self, line):
|
def isCreateBackup(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
@ -18,5 +19,5 @@ class CreateBackupCommandBuilder:
|
||||||
parser = CreateBackupParser()
|
parser = CreateBackupParser()
|
||||||
parser.parseLine(line)
|
parser.parseLine(line)
|
||||||
|
|
||||||
command = CreateBackupCommand()
|
command = CreateBackupCommand(self.ignoreBackup)
|
||||||
return command
|
return command
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
|
from CommandBuilders.BuilderBackupCommands.BaseBackupCommandBuilder import BaseBackupCommandBuilder
|
||||||
from commands.BaseBackupCommand.DeleteBackupCommand import DeleteBackupCommand
|
from commands.BaseBackupCommand.DeleteBackupCommand import DeleteBackupCommand
|
||||||
from parsers.ParserBackup.DeleteBackupParser import DeleteBackupParser
|
from parsers.ParserBackup.DeleteBackupParser import DeleteBackupParser
|
||||||
|
|
||||||
|
|
||||||
class DeleteBackupCommandBuilder:
|
class DeleteBackupCommandBuilder(BaseBackupCommandBuilder):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackupStr):
|
||||||
pass
|
BaseBackupCommandBuilder.__init__(self, ignoreBackupStr)
|
||||||
|
|
||||||
def isDeleteBackup(self, line):
|
def isDeleteBackup(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
@ -20,5 +21,5 @@ class DeleteBackupCommandBuilder:
|
||||||
parser = DeleteBackupParser()
|
parser = DeleteBackupParser()
|
||||||
parser.parseLine(line)
|
parser.parseLine(line)
|
||||||
|
|
||||||
command = DeleteBackupCommand()
|
command = DeleteBackupCommand(self.ignoreBackup)
|
||||||
return command
|
return command
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
|
from CommandBuilders.BuilderBackupCommands.BaseBackupCommandBuilder import BaseBackupCommandBuilder
|
||||||
from commands.BaseBackupCommand.RestoreBackupCommand import RestoreBackupCommand
|
from commands.BaseBackupCommand.RestoreBackupCommand import RestoreBackupCommand
|
||||||
from parsers.ParserBackup.RestoreBackupParser import RestoreBackupParser
|
from parsers.ParserBackup.RestoreBackupParser import RestoreBackupParser
|
||||||
|
|
||||||
|
|
||||||
class RestoreBackupCommandBuilder:
|
class RestoreBackupCommandBuilder(BaseBackupCommandBuilder):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackupStr):
|
||||||
pass
|
BaseBackupCommandBuilder.__init__(self, ignoreBackupStr)
|
||||||
|
|
||||||
def isRestoreBackup(self, line):
|
def isRestoreBackup(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
@ -20,5 +21,5 @@ class RestoreBackupCommandBuilder:
|
||||||
parser = RestoreBackupParser()
|
parser = RestoreBackupParser()
|
||||||
parser.parseLine(line)
|
parser.parseLine(line)
|
||||||
|
|
||||||
command = RestoreBackupCommand()
|
command = RestoreBackupCommand(self.ignoreBackup)
|
||||||
return command
|
return command
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'rzaitov'
|
||||||
|
|
@ -1,21 +1,46 @@
|
||||||
|
import os
|
||||||
from commands.CopyCommand import CopyCommand
|
from commands.CopyCommand import CopyCommand
|
||||||
|
from parsers.CopyParser.CopyArguments import CopyArguments
|
||||||
from parsers.InstallProfileParser import InstallProfileParser
|
from parsers.InstallProfileParser import InstallProfileParser
|
||||||
|
|
||||||
|
|
||||||
class InstallProfileCommandBuilder:
|
class InstallProfileCommandBuilder:
|
||||||
def __init__(self):
|
def __init__(self, profileFilePrefix):
|
||||||
pass
|
assert profileFilePrefix is not None
|
||||||
|
|
||||||
|
self.profileFilePrefix = profileFilePrefix
|
||||||
|
self.profileStorageDir = '~/Library/MobileDevice/Provisioning Profiles/'
|
||||||
|
|
||||||
def isInstallProfile(self, line):
|
def isInstallProfile(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
return line.startswith('install profile')
|
parser = InstallProfileParser()
|
||||||
|
isValid = parser.isValidLine(line)
|
||||||
|
|
||||||
|
return isValid
|
||||||
|
|
||||||
def getCommandFor(self, line):
|
def getCommandFor(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
parser = InstallProfileParser()
|
parser = InstallProfileParser()
|
||||||
cpArgs = parser.parseLine(line)
|
|
||||||
|
srcPath = parser.parseLine(line)
|
||||||
|
dstPath = self.getDestinationPath(srcPath)
|
||||||
|
|
||||||
|
cpArgs = CopyArguments()
|
||||||
|
cpArgs.setArguments(srcPath, dstPath)
|
||||||
|
|
||||||
command = CopyCommand(cpArgs)
|
command = CopyCommand(cpArgs)
|
||||||
return command
|
return command
|
||||||
|
|
||||||
|
def getDestinationPath(self, sourcePath):
|
||||||
|
dstProfileFileName = self.fetchDstFileName(sourcePath)
|
||||||
|
dstProfilePath = os.path.join(self.profileStorageDir, dstProfileFileName)
|
||||||
|
|
||||||
|
return dstProfilePath
|
||||||
|
|
||||||
|
def fetchDstFileName(self, srcFilePath):
|
||||||
|
profileFileName = os.path.basename(srcFilePath)
|
||||||
|
profileFileName = '{0}.{1}'.format(self.profileFilePrefix, profileFileName)
|
||||||
|
|
||||||
|
return profileFileName
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
from commands.PatchInfoPlistCommand import PatchInfoPlistCommand
|
||||||
|
from parsers.InsideParser.InsideSetArrayParser import InsideSetArrayParser
|
||||||
|
|
||||||
|
|
||||||
|
class PatchInfoPlistArrayCommandBuilder:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def isPatchInfoPlist(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
parser = self.createParser()
|
||||||
|
isValid = parser.isValidLine(line)
|
||||||
|
|
||||||
|
return isValid
|
||||||
|
|
||||||
|
def getCommandFor(self, line):
|
||||||
|
parser = self.createParser()
|
||||||
|
result = parser.parseLine(line)
|
||||||
|
|
||||||
|
path = result[0]
|
||||||
|
key = result[1]
|
||||||
|
value = parser.values
|
||||||
|
|
||||||
|
command = PatchInfoPlistCommand(path, key, value)
|
||||||
|
return command
|
||||||
|
|
||||||
|
def createParser(self):
|
||||||
|
parser = InsideSetArrayParser('plist')
|
||||||
|
return parser
|
||||||
|
|
||||||
|
|
@ -11,13 +11,13 @@ class PatchInfoplistCommandBuilder:
|
||||||
def isPatchInfoPlist(self, line):
|
def isPatchInfoPlist(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
parser = self.__createParser()
|
parser = self.createParser()
|
||||||
isValid = parser.isValidLine(line)
|
isValid = parser.isValidLine(line)
|
||||||
|
|
||||||
return isValid
|
return isValid
|
||||||
|
|
||||||
def getCommandFor(self, line):
|
def getCommandFor(self, line):
|
||||||
parser = self.__createParser()
|
parser = self.createParser()
|
||||||
result = parser.parseLine(line)
|
result = parser.parseLine(line)
|
||||||
|
|
||||||
path = result[0]
|
path = result[0]
|
||||||
|
|
@ -27,7 +27,7 @@ class PatchInfoplistCommandBuilder:
|
||||||
command = PatchInfoPlistCommand(path, key, value)
|
command = PatchInfoPlistCommand(path, key, value)
|
||||||
return command
|
return command
|
||||||
|
|
||||||
def __createParser(self):
|
def createParser(self):
|
||||||
parser = InsideSetParser('plist')
|
parser = InsideSetParser('plist')
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
from commands.PatchManifestCommand import PatchManifestCommand
|
||||||
|
from parsers.InsideParser.InsideSetParser import InsideSetParser
|
||||||
|
|
||||||
|
|
||||||
|
class PatchManifestCommandBuilder:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def isManifestCommand(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
parser = InsideSetParser('xml')
|
||||||
|
isValid = parser.isValidLine(line)
|
||||||
|
|
||||||
|
return isValid
|
||||||
|
|
||||||
|
def getCommandFor(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
parser = InsideSetParser('xml')
|
||||||
|
result = parser.parseLine(line)
|
||||||
|
|
||||||
|
command = PatchManifestCommand(result[0], result[1], result[2])
|
||||||
|
return command
|
||||||
|
|
@ -20,8 +20,8 @@ class RemoveProjectCommandBuilder:
|
||||||
parser = InsideRemoveParser('sln')
|
parser = InsideRemoveParser('sln')
|
||||||
result = parser.parseLine(line)
|
result = parser.parseLine(line)
|
||||||
|
|
||||||
slnPath = result[0]
|
slnPath = result['file_path']
|
||||||
projectName = result[1]
|
projectNames = result['names']
|
||||||
|
|
||||||
command = RemoveProjectCommand(slnPath, projectName)
|
command = RemoveProjectCommand(slnPath, projectNames)
|
||||||
return command
|
return command
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from commands.ShCommand import ShCommand
|
from commands.ShTextCommand import ShTextCommand
|
||||||
from parsers.ShParser import ShParser
|
from parsers.ShParser import ShParser
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -19,5 +19,5 @@ class ShCommandBuilder:
|
||||||
|
|
||||||
cmdText = parser.parseLine(line)
|
cmdText = parser.parseLine(line)
|
||||||
|
|
||||||
command = ShCommand(cmdText)
|
command = ShTextCommand(cmdText)
|
||||||
return command
|
return command
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
from commands.CleanBuildCommands.SignApkCommand import SignApkCommand
|
||||||
|
from parsers.SignApkParser import SignApkParser
|
||||||
|
|
||||||
|
|
||||||
|
class SignApkCommandBuilder:
|
||||||
|
def __init__(self, pathToBuildUtil):
|
||||||
|
assert pathToBuildUtil is not None
|
||||||
|
|
||||||
|
self.pathToBuildUtil = pathToBuildUtil
|
||||||
|
|
||||||
|
def isSignApk(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
parser = SignApkParser()
|
||||||
|
isValid = parser.isValidLine(line)
|
||||||
|
|
||||||
|
return isValid
|
||||||
|
|
||||||
|
def getCommandFor(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
parser = SignApkParser()
|
||||||
|
result = parser.parseLine(line)
|
||||||
|
|
||||||
|
slnPath = result[0]
|
||||||
|
slnConfig = result[1]
|
||||||
|
projectName = result[2]
|
||||||
|
|
||||||
|
command = SignApkCommand(self.pathToBuildUtil, slnPath, slnConfig, projectName)
|
||||||
|
return command
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
class CommentRemover:
|
from Core.LineConveyor.PreprocessorBase import PreprocessorBase
|
||||||
|
|
||||||
|
|
||||||
|
class CommentRemover(PreprocessorBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
PreprocessorBase.__init__(self)
|
||||||
|
|
||||||
def processText(self, line, conveyorProcessor):
|
def processText(self, line, conveyorProcessor):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
class MacroResolver:
|
from Core.LineConveyor.PreprocessorBase import PreprocessorBase
|
||||||
|
|
||||||
|
|
||||||
|
class MacroResolver(PreprocessorBase):
|
||||||
def __init__(self, macroProcessor, valueProvider):
|
def __init__(self, macroProcessor, valueProvider):
|
||||||
|
PreprocessorBase.__init__(self)
|
||||||
|
|
||||||
assert macroProcessor is not None
|
assert macroProcessor is not None
|
||||||
assert valueProvider is not None
|
assert valueProvider is not None
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
from Core.LineConveyor.PreprocessorBase import PreprocessorBase
|
||||||
|
|
||||||
|
|
||||||
|
class NullPreprocessor(PreprocessorBase):
|
||||||
|
def __init__(self):
|
||||||
|
PreprocessorBase.__init__(self)
|
||||||
|
|
||||||
|
def processText(self, text, conveyorProcessor):
|
||||||
|
return text
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import abc
|
||||||
|
|
||||||
|
|
||||||
|
class PreprocessorBase(object):
|
||||||
|
__metaclass__ = abc.ABCMeta
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def processText(self, line, conveyorProcessor):
|
||||||
|
pass
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
class Stripper:
|
from Core.LineConveyor.PreprocessorBase import PreprocessorBase
|
||||||
|
|
||||||
|
|
||||||
|
class Stripper(PreprocessorBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
PreprocessorBase.__init__(self)
|
||||||
|
|
||||||
def processText(self, line, conveyorProcessor):
|
def processText(self, line, conveyorProcessor):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
class TextConveyorPreprocessor:
|
from Core.LineConveyor.PreprocessorBase import PreprocessorBase
|
||||||
|
|
||||||
|
|
||||||
|
class TextConveyorPreprocessor(PreprocessorBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
PreprocessorBase.__init__(self)
|
||||||
self.processors = []
|
self.processors = []
|
||||||
|
|
||||||
def addProcessor(self, processor):
|
def addProcessor(self, processor):
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
class TextInclude:
|
from Core.LineConveyor.PreprocessorBase import PreprocessorBase
|
||||||
|
|
||||||
|
|
||||||
|
class TextInclude(PreprocessorBase):
|
||||||
def __init__(self, includeProcessor, contentProvider):
|
def __init__(self, includeProcessor, contentProvider):
|
||||||
|
PreprocessorBase.__init__(self)
|
||||||
|
|
||||||
assert includeProcessor is not None
|
assert includeProcessor is not None
|
||||||
assert contentProvider is not None
|
assert contentProvider is not None
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
|
from CommandBuilders.BuilderBackupCommands.CreateBackupCommandBuilder import CreateBackupCommandBuilder
|
||||||
|
from CommandBuilders.BuilderBackupCommands.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
|
||||||
|
from CommandBuilders.BuilderBackupCommands.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
|
||||||
|
|
||||||
from CommandBuilders.CleanBuildCommandBuilder import CleanBuildCommandBuilder
|
from CommandBuilders.CleanBuildCommandBuilder import CleanBuildCommandBuilder
|
||||||
from CommandBuilders.CopyCommandBuilder import CopyCommandBuilder
|
from CommandBuilders.CopyCommandBuilder import CopyCommandBuilder
|
||||||
from CommandBuilders.CreateBackupCommandBuilder import CreateBackupCommandBuilder
|
|
||||||
from CommandBuilders.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
|
|
||||||
from CommandBuilders.InstallProfileCommandBuilder import InstallProfileCommandBuilder
|
from CommandBuilders.InstallProfileCommandBuilder import InstallProfileCommandBuilder
|
||||||
from CommandBuilders.MakeDirsCommandBuilder import MakeDirsCommandBuilder
|
from CommandBuilders.MakeDirsCommandBuilder import MakeDirsCommandBuilder
|
||||||
from CommandBuilders.PatchCsprojCommandBuilder import PatchCsprojCommandBuilder
|
from CommandBuilders.PatchCsprojCommandBuilder import PatchCsprojCommandBuilder
|
||||||
|
from CommandBuilders.PatchInfoPlistArrayCommandBuilder import PatchInfoPlistArrayCommandBuilder
|
||||||
from CommandBuilders.PatchInfoplistCommandBuilder import PatchInfoplistCommandBuilder
|
from CommandBuilders.PatchInfoplistCommandBuilder import PatchInfoplistCommandBuilder
|
||||||
|
from CommandBuilders.PatchManifestCommandBuilder import PatchManifestCommandBuilder
|
||||||
from CommandBuilders.RemoveProjectCommandBuilder import RemoveProjectCommandBuilder
|
from CommandBuilders.RemoveProjectCommandBuilder import RemoveProjectCommandBuilder
|
||||||
from CommandBuilders.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
|
|
||||||
from CommandBuilders.ShCommandBuilder import ShCommandBuilder
|
from CommandBuilders.ShCommandBuilder import ShCommandBuilder
|
||||||
|
from CommandBuilders.SignApkBuilder import SignApkCommandBuilder
|
||||||
from CommandBuilders.TestflightCommandBuilder import TestflightCommandBuilder
|
from CommandBuilders.TestflightCommandBuilder import TestflightCommandBuilder
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -23,19 +27,27 @@ class StepsRunner:
|
||||||
|
|
||||||
self.shCommandBuilder = ShCommandBuilder()
|
self.shCommandBuilder = ShCommandBuilder()
|
||||||
self.removeProjectBuilder = RemoveProjectCommandBuilder()
|
self.removeProjectBuilder = RemoveProjectCommandBuilder()
|
||||||
self.createBackupBuilder = CreateBackupCommandBuilder()
|
|
||||||
self.restoreFromBackupBuilder = RestoreBackupCommandBuilder()
|
|
||||||
self.deleteBackupBuilder = DeleteBackupCommandBuilder()
|
|
||||||
self.createDirs = MakeDirsCommandBuilder()
|
self.createDirs = MakeDirsCommandBuilder()
|
||||||
self.patchCsproj = PatchCsprojCommandBuilder()
|
self.patchCsproj = PatchCsprojCommandBuilder()
|
||||||
self.patchInfoPlist = PatchInfoplistCommandBuilder(self.valueProvider)
|
self.patchInfoPlist = PatchInfoplistCommandBuilder(self.valueProvider)
|
||||||
|
self.patchInfoPlistArray = PatchInfoPlistArrayCommandBuilder()
|
||||||
|
self.patchManifest = PatchManifestCommandBuilder()
|
||||||
self.copyBuilder = CopyCommandBuilder()
|
self.copyBuilder = CopyCommandBuilder()
|
||||||
self.testflightBuilder = TestflightCommandBuilder()
|
self.testflightBuilder = TestflightCommandBuilder()
|
||||||
self.installProfileBuilder = InstallProfileCommandBuilder()
|
|
||||||
|
ignoreBackup = config.get('backup_ignore', None)
|
||||||
|
self.createBackupBuilder = CreateBackupCommandBuilder(ignoreBackup)
|
||||||
|
self.restoreFromBackupBuilder = RestoreBackupCommandBuilder(ignoreBackup)
|
||||||
|
self.deleteBackupBuilder = DeleteBackupCommandBuilder(ignoreBackup)
|
||||||
|
|
||||||
|
|
||||||
|
profilePrefix = config['project_name']
|
||||||
|
self.installProfileBuilder = InstallProfileCommandBuilder(profilePrefix)
|
||||||
|
|
||||||
buildUtilPath = config['build_tool']
|
buildUtilPath = config['build_tool']
|
||||||
self.cleanBuilder = CleanBuildCommandBuilder(buildUtilPath, 'clean')
|
self.cleanBuilder = CleanBuildCommandBuilder(buildUtilPath, 'clean')
|
||||||
self.buildBuilder = CleanBuildCommandBuilder(buildUtilPath, 'build')
|
self.buildBuilder = CleanBuildCommandBuilder(buildUtilPath, 'build')
|
||||||
|
self.signAndroid = SignApkCommandBuilder(buildUtilPath)
|
||||||
|
|
||||||
def run(self, content):
|
def run(self, content):
|
||||||
assert content is not None
|
assert content is not None
|
||||||
|
|
@ -58,6 +70,8 @@ class StepsRunner:
|
||||||
cmd = self.cleanBuilder.getCommandFor(line)
|
cmd = self.cleanBuilder.getCommandFor(line)
|
||||||
elif self.buildBuilder.isCleanBuild(line):
|
elif self.buildBuilder.isCleanBuild(line):
|
||||||
cmd = self.buildBuilder.getCommandFor(line)
|
cmd = self.buildBuilder.getCommandFor(line)
|
||||||
|
elif self.signAndroid.isSignApk(line):
|
||||||
|
cmd = self.signAndroid.getCommandFor(line)
|
||||||
elif self.createBackupBuilder.isCreateBackup(line):
|
elif self.createBackupBuilder.isCreateBackup(line):
|
||||||
cmd = self.createBackupBuilder.getCommandFor(line)
|
cmd = self.createBackupBuilder.getCommandFor(line)
|
||||||
elif self.createDirs.isMakeDirsCommand(line):
|
elif self.createDirs.isMakeDirsCommand(line):
|
||||||
|
|
@ -66,6 +80,10 @@ class StepsRunner:
|
||||||
cmd = self.patchCsproj.getCommandFor(line)
|
cmd = self.patchCsproj.getCommandFor(line)
|
||||||
elif self.patchInfoPlist.isPatchInfoPlist(line):
|
elif self.patchInfoPlist.isPatchInfoPlist(line):
|
||||||
cmd = self.patchInfoPlist.getCommandFor(line)
|
cmd = self.patchInfoPlist.getCommandFor(line)
|
||||||
|
elif self.patchInfoPlistArray.isPatchInfoPlist(line):
|
||||||
|
cmd = self.patchInfoPlistArray.getCommandFor(line)
|
||||||
|
elif self.patchManifest.isManifestCommand(line):
|
||||||
|
cmd = self.patchManifest.getCommandFor(line)
|
||||||
elif self.copyBuilder.isCopy(line):
|
elif self.copyBuilder.isCopy(line):
|
||||||
cmd =self.copyBuilder.getCommandFor(line)
|
cmd =self.copyBuilder.getCommandFor(line)
|
||||||
elif self.restoreFromBackupBuilder.isRestoreBackup(line):
|
elif self.restoreFromBackupBuilder.isRestoreBackup(line):
|
||||||
|
|
@ -80,4 +98,6 @@ class StepsRunner:
|
||||||
msg = "unrecognised step. Line: '{0}'".format(line)
|
msg = "unrecognised step. Line: '{0}'".format(line)
|
||||||
raise Exception(msg)
|
raise Exception(msg)
|
||||||
|
|
||||||
|
print 'start: {0}'.format(line)
|
||||||
cmd.execute()
|
cmd.execute()
|
||||||
|
print 'finish: {0}'.format(line)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
from Core.LineConveyor.NullPreprocessor import NullPreprocessor
|
||||||
from Core.SettingsProviderBase import SettingsProviderBase
|
from Core.SettingsProviderBase import SettingsProviderBase
|
||||||
from parsers.SettingsParser.SettingsParser import SettingsParser
|
from parsers.SettingsParser.SettingsParser import SettingsParser
|
||||||
|
|
||||||
|
|
@ -10,7 +11,9 @@ class SettingsProviderStub(SettingsProviderBase):
|
||||||
self.settingsText = settingsText
|
self.settingsText = settingsText
|
||||||
|
|
||||||
def fetchSettings(self):
|
def fetchSettings(self):
|
||||||
parser = SettingsParser()
|
preprocessor = NullPreprocessor()
|
||||||
|
|
||||||
|
parser = SettingsParser(preprocessor, None)
|
||||||
parser.parse(self.settingsText)
|
parser.parse(self.settingsText)
|
||||||
|
|
||||||
return parser.settings
|
return parser.settings
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
from CommandBuilders.CreateBackupCommandBuilder import CreateBackupCommandBuilder
|
from CommandBuilders.BuilderBackupCommands.CreateBackupCommandBuilder import CreateBackupCommandBuilder
|
||||||
|
|
||||||
line = "create backup"
|
line = "create backup"
|
||||||
|
|
||||||
cmdBuilder = CreateBackupCommandBuilder()
|
cmdBuilder = CreateBackupCommandBuilder(None)
|
||||||
command = cmdBuilder.getCommandFor(line)
|
command = cmdBuilder.getCommandFor(line)
|
||||||
|
|
||||||
command.execute()
|
command.execute()
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
from CommandBuilders.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
|
from CommandBuilders.BuilderBackupCommands.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
|
||||||
|
|
||||||
line = "delete backup"
|
line = "delete backup"
|
||||||
|
|
||||||
cmdBuilder = DeleteBackupCommandBuilder()
|
cmdBuilder = DeleteBackupCommandBuilder(None)
|
||||||
command = cmdBuilder.getCommandFor(line)
|
command = cmdBuilder.getCommandFor(line)
|
||||||
|
|
||||||
command.execute()
|
command.execute()
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
from CommandBuilders.PatchInfoPlistArrayCommandBuilder import PatchInfoPlistArrayCommandBuilder
|
||||||
|
|
||||||
|
line = "inside 'BuildSample/BuildSample/Info.plist' set UISupportedInterfaceOrientations with values 'value1:value2:value3'"
|
||||||
|
|
||||||
|
cmdBuilder = PatchInfoPlistArrayCommandBuilder()
|
||||||
|
command = cmdBuilder.getCommandFor(line)
|
||||||
|
command.execute()
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@ from CommandBuilders.InstallProfileCommandBuilder import InstallProfileCommandBu
|
||||||
|
|
||||||
line = "install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'"
|
line = "install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'"
|
||||||
|
|
||||||
builder = InstallProfileCommandBuilder()
|
builder = InstallProfileCommandBuilder('BsProject')
|
||||||
command = builder.getCommandFor(line)
|
command = builder.getCommandFor(line)
|
||||||
|
|
||||||
command.execute()
|
command.execute()
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
from Core.ContentProviderBase import ContentProviderBase
|
from Core.ContentProviderBase import ContentProviderBase
|
||||||
|
from Core.LineConveyor.NullPreprocessor import NullPreprocessor
|
||||||
from Tests.Common.SettingsProviderStub import SettingsProviderStub
|
from Tests.Common.SettingsProviderStub import SettingsProviderStub
|
||||||
from taskRunner import TaskRunner
|
from taskRunner import TaskRunner
|
||||||
|
from utils.BuildConfigProvider.BuildConfigProvider import BuildConfigProvider
|
||||||
|
|
||||||
settingsText = """
|
settingsText = """
|
||||||
build_tool = '/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool'
|
build_tool = '/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool'
|
||||||
|
|
@ -42,6 +44,9 @@ class ContentProviderMock(ContentProviderBase):
|
||||||
settingsProvider = SettingsProviderStub(settingsText)
|
settingsProvider = SettingsProviderStub(settingsText)
|
||||||
contentProvider = ContentProviderMock()
|
contentProvider = ContentProviderMock()
|
||||||
|
|
||||||
taskRunner = TaskRunner(settingsProvider, contentProvider)
|
buildConfigProvider = BuildConfigProvider()
|
||||||
|
preprocessor = NullPreprocessor()
|
||||||
|
|
||||||
|
taskRunner = TaskRunner(settingsProvider, contentProvider, buildConfigProvider, preprocessor, {})
|
||||||
|
|
||||||
taskRunner.run()
|
taskRunner.run()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
from CommandBuilders.PatchManifestCommandBuilder import PatchManifestCommandBuilder
|
||||||
|
|
||||||
|
line = "inside 'BuildSample/DroidApp/Properties/AndroidManifest.xml' set android:versionCode to '7.7.7'"
|
||||||
|
|
||||||
|
builder = PatchManifestCommandBuilder()
|
||||||
|
|
||||||
|
command = builder.getCommandFor(line)
|
||||||
|
command.execute()
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from Core.ContentProviderBase import ContentProviderBase
|
from Core.ContentProviderBase import ContentProviderBase
|
||||||
|
from Core.LineConveyor.NullPreprocessor import NullPreprocessor
|
||||||
from Tests.Common.SettingsProviderStub import SettingsProviderStub
|
from Tests.Common.SettingsProviderStub import SettingsProviderStub
|
||||||
from taskRunner import TaskRunner
|
from taskRunner import TaskRunner
|
||||||
from utils.BuildConfigProvider.BuildConfigProvider import BuildConfigProvider
|
from utils.BuildConfigProvider.BuildConfigProvider import BuildConfigProvider
|
||||||
|
|
@ -37,8 +38,9 @@ buildConfigProvider = BuildConfigProvider()
|
||||||
resolvedBuildConfigProvider = ResolvedBuildConfigProvider(buildConfigProvider)
|
resolvedBuildConfigProvider = ResolvedBuildConfigProvider(buildConfigProvider)
|
||||||
|
|
||||||
contentProvider = ContentProviderMock()
|
contentProvider = ContentProviderMock()
|
||||||
|
preprocessor = NullPreprocessor()
|
||||||
|
|
||||||
taskRunner = TaskRunner(settingsProvider, contentProvider, resolvedBuildConfigProvider)
|
taskRunner = TaskRunner(settingsProvider, contentProvider, resolvedBuildConfigProvider, preprocessor, {})
|
||||||
|
|
||||||
taskRunner.run()
|
taskRunner.run()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
from CommandBuilders.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
|
from CommandBuilders.BuilderBackupCommands.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
|
||||||
|
|
||||||
line = "restore from backup"
|
line = "restore from backup"
|
||||||
|
|
||||||
builder = RestoreBackupCommandBuilder()
|
builder = RestoreBackupCommandBuilder(None)
|
||||||
command = builder.getCommandFor(line)
|
command = builder.getCommandFor(line)
|
||||||
|
|
||||||
command.execute()
|
command.execute()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from commands.ShCommand import ShCommand
|
from commands.ShTextCommand import ShTextCommand
|
||||||
|
|
||||||
calendarCommand = ShCommand('cal 12 2013')
|
calendarCommand = ShTextCommand('cal 12 2013')
|
||||||
calendarCommand.execute()
|
calendarCommand.execute()
|
||||||
|
|
||||||
touchCommand = ShCommand('touch ../tmp.txt')
|
touchCommand = ShTextCommand('touch ../tmp.txt')
|
||||||
touchCommand.execute()
|
touchCommand.execute()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'rzaitov'
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import unittest
|
||||||
|
from utils.CsprojPatcher import CsprojPatcher
|
||||||
|
|
||||||
|
|
||||||
|
class TestCsprojPatcher(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.patcher = CsprojPatcher('NotExists.sln')
|
||||||
|
|
||||||
|
def test_CheckPropertyGroupCondition(self):
|
||||||
|
self.checkFit(" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ", 'Debug|iPhoneSimulator')
|
||||||
|
self.checkFit(" '$(Configuration)|$(Platform)'=='Debug|iPhoneSimulator' ", 'Debug|iPhoneSimulator')
|
||||||
|
self.checkFit("'$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator'", 'Debug|iPhoneSimulator')
|
||||||
|
self.checkFit("'$(Configuration)|$(Platform)'=='Debug|iPhoneSimulator'", 'Debug|iPhoneSimulator')
|
||||||
|
|
||||||
|
self.checkFit(" '$(Configuration)' == '' ", '')
|
||||||
|
self.checkFit(" '$(Configuration)'=='' ", '')
|
||||||
|
self.checkFit("'$(Configuration)' == ''", '')
|
||||||
|
self.checkFit("'$(Configuration)'==''", '')
|
||||||
|
|
||||||
|
def checkFit(self, conditionAttrValue, slnConfig):
|
||||||
|
isFit = self.patcher.IsValueFitFor(slnConfig, conditionAttrValue)
|
||||||
|
self.assertTrue(True, isFit)
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ another bla
|
||||||
<include 'paht2'>
|
<include 'paht2'>
|
||||||
yet another bla"""
|
yet another bla"""
|
||||||
|
|
||||||
processedText = self.includeText.processText(text)
|
processedText = self.includeText.processText(text, self.includeText)
|
||||||
|
|
||||||
expected = """
|
expected = """
|
||||||
bla bla
|
bla bla
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'rzaitov'
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
import unittest
|
||||||
|
from parsers.InsideParser.InsideRemoveParser import InsideRemoveParser
|
||||||
|
|
||||||
|
|
||||||
|
class TestInsideRemoveParser(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.parser = InsideRemoveParser('ext')
|
||||||
|
|
||||||
|
def test_parse(self):
|
||||||
|
self.check("inside 'Some/Path/file.ext' remove 'PROGECT' project", 'Some/Path/file.ext', ['PROGECT'])
|
||||||
|
|
||||||
|
self.check("inside 'file.ext' remove 'PR' projects", 'file.ext', ['PR'])
|
||||||
|
self.check("inside 'file.ext' remove 'PR' projects", 'file.ext', ['PR'])
|
||||||
|
|
||||||
|
self.check("inside 'file.ext' remove 'pr1:pr2:pr3' projects", 'file.ext', ['pr1', 'pr2', 'pr3'])
|
||||||
|
|
||||||
|
def check(self, line, filePath, expectedNames):
|
||||||
|
result = self.parser.parseLine(line)
|
||||||
|
|
||||||
|
self.assertEqual(filePath, result['file_path'])
|
||||||
|
self.assertListEqual(expectedNames, result['names'])
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
from Tests.UnitTests.LineParserTestCaseBase import LineParserTestCaseBase
|
||||||
|
from parsers.InsideParser.InsideSetArrayParser import InsideSetArrayParser
|
||||||
|
|
||||||
|
|
||||||
|
class TestInsideSetArrayParser(LineParserTestCaseBase):
|
||||||
|
_validSingleValueTest = "inside 'my.txt' set KEY with values 'value1'"
|
||||||
|
_validMultiValueTest = "inside 'my.txt' set KEY with values 'value1:value2:value3'"
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.textParser = InsideSetArrayParser('txt')
|
||||||
|
|
||||||
|
def test_isValid(self):
|
||||||
|
self.isValidText(TestInsideSetArrayParser._validSingleValueTest)
|
||||||
|
self.isValidText(TestInsideSetArrayParser._validMultiValueTest)
|
||||||
|
self.isValidText("inside 'my.txt' set KEY with values 'value1:value2:value3'")
|
||||||
|
|
||||||
|
def test_isNotValid(self):
|
||||||
|
self.isNotValidText("inside 'my.sln' set KEY with values 'value1'")
|
||||||
|
self.isNotValidText("inside 'my.sln' set KEY with values 'value1:value2'")
|
||||||
|
self.isNotValidText("inside 'my.txt' set KEY with values 'value1' ")
|
||||||
|
self.isNotValidText("inside 'my.txt' set KEY with values 'value1' bla bla")
|
||||||
|
|
||||||
|
|
||||||
|
def test_parse(self):
|
||||||
|
self.checkParse(TestInsideSetArrayParser._validSingleValueTest, 'my.txt', 'KEY', 'value1')
|
||||||
|
self.checkParse(TestInsideSetArrayParser._validMultiValueTest, 'my.txt', 'KEY', 'value1:value2:value3')
|
||||||
|
|
||||||
|
def test_values(self):
|
||||||
|
self.checkValues(TestInsideSetArrayParser._validSingleValueTest, ['value1'])
|
||||||
|
self.checkValues(TestInsideSetArrayParser._validMultiValueTest, ['value1', 'value2', 'value3'])
|
||||||
|
|
||||||
|
def checkParse(self, line, filePath, key, value):
|
||||||
|
result = self.textParser.parseLine(line)
|
||||||
|
|
||||||
|
self.assertEqual(filePath, result[0])
|
||||||
|
self.assertEqual(key, result[1])
|
||||||
|
self.assertEqual(value, result[2])
|
||||||
|
|
||||||
|
def checkValues(self, text, expectedValues):
|
||||||
|
self.textParser.parseLine(text)
|
||||||
|
|
||||||
|
self.assertEqual(len(expectedValues), len(self.textParser.values))
|
||||||
|
|
||||||
|
for v in self.textParser.values:
|
||||||
|
self.assertTrue(v in expectedValues)
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import unittest
|
||||||
|
from CommandBuilders.InstallProfileCommandBuilder import InstallProfileCommandBuilder
|
||||||
|
|
||||||
|
|
||||||
|
class TestInstallProfileBuilder(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.prefix = 'MyProject'
|
||||||
|
self.builder = InstallProfileCommandBuilder(self.prefix)
|
||||||
|
|
||||||
|
def test_dstFileName(self):
|
||||||
|
dstFileName = self.builder.fetchDstFileName('/Some/Path/MyProfile.ext')
|
||||||
|
self.assertEqual(dstFileName, '{0}.MyProfile.ext'.format(self.prefix))
|
||||||
|
|
||||||
|
def test_dstPath(self):
|
||||||
|
dstPath = self.builder.getDestinationPath('/Some/Path/MyProfile.ext')
|
||||||
|
self.assertEqual('~/Library/MobileDevice/Provisioning Profiles/{0}.MyProfile.ext'.format(self.prefix), dstPath)
|
||||||
|
|
@ -8,7 +8,6 @@ class TestInstallProfile(unittest.TestCase):
|
||||||
|
|
||||||
def test_parse(self):
|
def test_parse(self):
|
||||||
line = "install profile 'Path/To/Profile.mobileprovision'"
|
line = "install profile 'Path/To/Profile.mobileprovision'"
|
||||||
copyArgs = self.parser.parseLine(line)
|
src = self.parser.parseLine(line)
|
||||||
|
|
||||||
self.assertEqual('Path/To/Profile.mobileprovision', copyArgs.source)
|
self.assertEqual('Path/To/Profile.mobileprovision', src)
|
||||||
self.assertEqual('~/Library/MobileDevice/Provisioning Profiles/Profile.mobileprovision', copyArgs.target)
|
|
||||||
|
|
@ -8,12 +8,12 @@ class TestCommentRemover(unittest.TestCase):
|
||||||
|
|
||||||
def test_startsWithComment(self):
|
def test_startsWithComment(self):
|
||||||
line = '# this line is comment'
|
line = '# this line is comment'
|
||||||
newLine = self.commentRemover.processText(line)
|
newLine = self.commentRemover.processText(line, None)
|
||||||
|
|
||||||
self.assertEqual('', newLine)
|
self.assertEqual('', newLine)
|
||||||
|
|
||||||
def test_containsComment(self):
|
def test_containsComment(self):
|
||||||
line = 'this line contains # a comment'
|
line = 'this line contains # a comment'
|
||||||
newLine = self.commentRemover.processText(line)
|
newLine = self.commentRemover.processText(line, None)
|
||||||
|
|
||||||
self.assertEqual('this line contains ', newLine)
|
self.assertEqual('this line contains ', newLine)
|
||||||
|
|
@ -21,6 +21,6 @@ class TestMacroResolver(unittest.TestCase):
|
||||||
|
|
||||||
def test_resolveLine(self):
|
def test_resolveLine(self):
|
||||||
line = '{@key1} bla {@some_name} version: {@version}'
|
line = '{@key1} bla {@some_name} version: {@version}'
|
||||||
newLine = self.macroResolver.processText(line)
|
newLine = self.macroResolver.processText(line, self.macroResolver)
|
||||||
|
|
||||||
self.assertEqual('hello world bla another name version: 1.2.3', newLine)
|
self.assertEqual('hello world bla another name version: 1.2.3', newLine)
|
||||||
|
|
@ -8,6 +8,6 @@ class TestStripper(unittest.TestCase):
|
||||||
|
|
||||||
def test_stripLine(self):
|
def test_stripLine(self):
|
||||||
line = ' \tSome text \t\r\n'
|
line = ' \tSome text \t\r\n'
|
||||||
newLine = self.stripper.processText(line)
|
newLine = self.stripper.processText(line, self.stripper)
|
||||||
|
|
||||||
self.assertEqual('Some text', newLine)
|
self.assertEqual('Some text', newLine)
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
from unittest.case import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
class LineParserTestCaseBase(TestCase):
|
||||||
|
def __init__(self, methodName):
|
||||||
|
TestCase.__init__(self, methodName)
|
||||||
|
|
||||||
|
self.textParser = None
|
||||||
|
|
||||||
|
def isValidText(self, text):
|
||||||
|
isValid = self.textParser.isValidLine(text)
|
||||||
|
|
||||||
|
self.assertEqual(True, isValid)
|
||||||
|
|
||||||
|
def isNotValidText(self, text):
|
||||||
|
isValid = self.textParser.isValidLine(text)
|
||||||
|
|
||||||
|
self.assertEqual(False, isValid)
|
||||||
|
|
@ -1,19 +1,15 @@
|
||||||
import unittest
|
from Tests.UnitTests.LineParserTestCaseBase import LineParserTestCaseBase
|
||||||
from parsers.ParserBackup.CreateBackupParser import CreateBackupParser
|
from parsers.ParserBackup.CreateBackupParser import CreateBackupParser
|
||||||
|
|
||||||
|
|
||||||
class TestCreateBackup(unittest.TestCase):
|
class TestCreateBackup(LineParserTestCaseBase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.parser = CreateBackupParser()
|
self.textParser = CreateBackupParser()
|
||||||
|
|
||||||
def test_isValid(self):
|
def test_isValid(self):
|
||||||
line = "create backup"
|
self.isValidText('create backup')
|
||||||
isValid = self.parser.isValidLine(line)
|
self.isValidText('create backup')
|
||||||
|
|
||||||
self.assertEqual(True, isValid)
|
|
||||||
|
|
||||||
def test_isNotValid(self):
|
def test_isNotValid(self):
|
||||||
line = "create backup bla bla"
|
self.isNotValidText('create backup ')
|
||||||
isValid = self.parser.isValidLine(line)
|
self.isNotValidText('create backup bla bla')
|
||||||
|
|
||||||
self.assertEqual(False, isValid)
|
|
||||||
|
|
@ -1,25 +1,15 @@
|
||||||
import unittest
|
from Tests.UnitTests.LineParserTestCaseBase import LineParserTestCaseBase
|
||||||
from parsers.ParserBackup.DeleteBackupParser import DeleteBackupParser
|
from parsers.ParserBackup.DeleteBackupParser import DeleteBackupParser
|
||||||
|
|
||||||
|
|
||||||
class TestDeleteBackup(unittest.TestCase):
|
class TestDeleteBackup(LineParserTestCaseBase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.parser = DeleteBackupParser()
|
self.textParser = DeleteBackupParser()
|
||||||
|
|
||||||
def test_parseCurrentDir(self):
|
def test_isValid(self):
|
||||||
line = "delete backup '.'"
|
self.isValidText('delete backup')
|
||||||
folderPath = self.parser.parseLine(line)
|
self.isValidText('delete backup')
|
||||||
|
|
||||||
self.assertEqual('.', folderPath)
|
def test_isNotValid(self):
|
||||||
|
self.isNotValidText('delete backup ')
|
||||||
def test_parseRelativePath(self):
|
self.isNotValidText('delete backup bla bla')
|
||||||
line = "delete backup '../Some/Path'"
|
|
||||||
folderPath = self.parser.parseLine(line)
|
|
||||||
|
|
||||||
self.assertEqual('../Some/Path', folderPath)
|
|
||||||
|
|
||||||
def test_parseAbsPath(self):
|
|
||||||
line = "delete backup '/Some/Abs/Path'"
|
|
||||||
folderPath = self.parser.parseLine(line)
|
|
||||||
|
|
||||||
self.assertEqual('/Some/Abs/Path', folderPath)
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,15 @@
|
||||||
import unittest
|
from Tests.UnitTests.LineParserTestCaseBase import LineParserTestCaseBase
|
||||||
from parsers.ParserBackup.RestoreBackupParser import RestoreBackupParser
|
from parsers.ParserBackup.RestoreBackupParser import RestoreBackupParser
|
||||||
|
|
||||||
|
|
||||||
class TestRestoreBackup(unittest.TestCase):
|
class TestRestoreBackup(LineParserTestCaseBase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.parser = RestoreBackupParser()
|
self.textParser = RestoreBackupParser()
|
||||||
|
|
||||||
def test_parseCurrentDir(self):
|
def test_isValid(self):
|
||||||
line = "restore from backup '.'"
|
self.isValidText('restore from backup')
|
||||||
folderPath = self.parser.parseLine(line)
|
self.isValidText('restore from backup')
|
||||||
|
|
||||||
self.assertEqual('.', folderPath)
|
def test_isNotValid(self):
|
||||||
|
self.isNotValidText('restore from backup ')
|
||||||
def test_parseRelativePath(self):
|
self.isNotValidText('restore from backup bla bla')
|
||||||
line = "restore from backup '../Some/Path'"
|
|
||||||
folderPath = self.parser.parseLine(line)
|
|
||||||
|
|
||||||
self.assertEqual('../Some/Path', folderPath)
|
|
||||||
|
|
||||||
def test_parseAbsPath(self):
|
|
||||||
line = "restore from backup '/Some/Abs/Path'"
|
|
||||||
folderPath = self.parser.parseLine(line)
|
|
||||||
|
|
||||||
self.assertEqual('/Some/Abs/Path', folderPath)
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'rzaitov'
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
import unittest
|
||||||
|
from parsers.SettingsParser.SettingsMerger import SettingsMerger
|
||||||
|
|
||||||
|
|
||||||
|
class TestSettingsMerger(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.merger = SettingsMerger()
|
||||||
|
|
||||||
|
self.child1 = {
|
||||||
|
'sub_key1': 'value3',
|
||||||
|
'sub_key2': 'value4',
|
||||||
|
}
|
||||||
|
|
||||||
|
self.child2 = {
|
||||||
|
'sub_key3': 'value5',
|
||||||
|
'sub_key4': 'value6',
|
||||||
|
}
|
||||||
|
|
||||||
|
self.globalSettings = {
|
||||||
|
'top_level_key1': 'value1',
|
||||||
|
'top_level_key2': 'value2',
|
||||||
|
|
||||||
|
'child1': self.child1,
|
||||||
|
'child2': self.child2
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_mergeTopLevelSettings(self):
|
||||||
|
description = {
|
||||||
|
'segments': ['top_level_key1'],
|
||||||
|
'value': 'new_value1'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.merger.merge(self.globalSettings, description)
|
||||||
|
|
||||||
|
self.assertEqual('new_value1', self.globalSettings['top_level_key1'])
|
||||||
|
self.assertEqual('value2', self.globalSettings['top_level_key2'])
|
||||||
|
|
||||||
|
def test_mergeSubElement(self):
|
||||||
|
description = {
|
||||||
|
'segments': ['child1', 'sub_key1'],
|
||||||
|
'value': 'new_value3'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.merger.merge(self.globalSettings, description)
|
||||||
|
|
||||||
|
self.assertEqual('value1', self.globalSettings['top_level_key1'])
|
||||||
|
self.assertEqual('value2', self.globalSettings['top_level_key2'])
|
||||||
|
|
||||||
|
self.assertEqual('new_value3', self.globalSettings['child1']['sub_key1'])
|
||||||
|
self.assertEqual('value4', self.globalSettings['child1']['sub_key2'])
|
||||||
|
|
||||||
|
def test_getPropertyName(self):
|
||||||
|
self.checkName(['one', 'two', 'three'], 'three')
|
||||||
|
self.checkName(['one', 'two'], 'two')
|
||||||
|
self.checkName(['one'], 'one')
|
||||||
|
|
||||||
|
def checkName(self, segments, expectedName):
|
||||||
|
name = self.merger.getPropertyName(segments)
|
||||||
|
self.assertEqual(name, expectedName)
|
||||||
|
|
||||||
|
def test_checkPath(self):
|
||||||
|
self.checkPath(['one', 'two', 'three'], ['one', 'two'])
|
||||||
|
self.checkPath(['one', 'two'], ['one'])
|
||||||
|
self.checkPath(['one'], [])
|
||||||
|
|
||||||
|
def checkPath(self, segments, expectedPath):
|
||||||
|
path = self.merger.getPath(segments)
|
||||||
|
|
||||||
|
self.assertListEqual(expectedPath, path)
|
||||||
|
|
||||||
|
def test_mergeNotExistTopLevelSetting(self):
|
||||||
|
description = {
|
||||||
|
'segments': ['new_key'],
|
||||||
|
'value': 'new_value'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.merger.merge(self.globalSettings, description)
|
||||||
|
self.assertEqual('new_value', self.globalSettings['new_key'])
|
||||||
|
|
||||||
|
def test_mergeNotExistSubSetting(self):
|
||||||
|
description = {
|
||||||
|
'segments': ['child1', 'new_key'],
|
||||||
|
'value': 'new_value'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.merger.merge(self.globalSettings, description)
|
||||||
|
self.assertEqual('new_value', self.globalSettings['child1']['new_key'])
|
||||||
|
|
||||||
|
|
||||||
|
def test_mergeNotExistSub(self):
|
||||||
|
description = {
|
||||||
|
'segments': ['child3', 'new_key'],
|
||||||
|
'value': 'new_value'
|
||||||
|
}
|
||||||
|
|
||||||
|
self.merger.merge(self.globalSettings, description)
|
||||||
|
self.assertEqual('new_value', self.globalSettings['child3']['new_key'])
|
||||||
|
|
||||||
|
|
||||||
|
def test_getSettingsDictionaryByPath(self):
|
||||||
|
dictionary1 = self.merger.getSettingsDictByPath(self.globalSettings, [])
|
||||||
|
self.assertEqual(self.globalSettings, dictionary1)
|
||||||
|
self.assertTrue(self.globalSettings == dictionary1)
|
||||||
|
|
||||||
|
dictionary2 = self.merger.getSettingsDictByPath(self.globalSettings, ['child1'])
|
||||||
|
self.assertTrue(self.child1 == dictionary2)
|
||||||
|
|
||||||
|
dictionary3 = self.merger.getSettingsDictByPath(self.globalSettings, ['child2'])
|
||||||
|
self.assertTrue(self.child2 == dictionary3)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,9 +7,27 @@ class TestSettingsLineParser(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.parser = SettingsLineParser()
|
self.parser = SettingsLineParser()
|
||||||
|
|
||||||
def test_getPathAndValue(self):
|
def test_whiteSpaces(self):
|
||||||
line = "abc.123.some_name = 'crazy value ±~ ../ 123'"
|
self.checkPathAndValue("abc.123.some_name = 'crazy value ±~ ../ 123'", 'abc.123.some_name', 'crazy value ±~ ../ 123')
|
||||||
|
self.checkPathAndValue("a.b.c = 'value'", 'a.b.c', 'value')
|
||||||
|
self.checkPathAndValue("a.b.c= 'value'", 'a.b.c', 'value')
|
||||||
|
self.checkPathAndValue("a.b.c ='value'", 'a.b.c', 'value')
|
||||||
|
self.checkPathAndValue("a.b.c='value'", 'a.b.c', 'value')
|
||||||
|
|
||||||
|
def test_valueWithoutComma(self):
|
||||||
|
self.checkPathAndValue("a.b.c = value", 'a.b.c', 'value')
|
||||||
|
self.checkPathAndValue("a.b.c = some value", 'a.b.c', 'some value')
|
||||||
|
self.checkPathAndValue("a.b.c = some value ", 'a.b.c', 'some value')
|
||||||
|
|
||||||
|
def test_valueWithEscapeComma(self):
|
||||||
|
self.checkPathAndValue("a.b.c = '\"value\"' ", 'a.b.c', '"value"')
|
||||||
|
self.checkPathAndValue('a.b.c = "\'value\'" ', 'a.b.c', "'value'")
|
||||||
|
|
||||||
|
self.checkPathAndValue('a.b.c = ""value"" ', 'a.b.c', 'value')
|
||||||
|
self.checkPathAndValue("a.b.c = ''value'' ", 'a.b.c', 'value')
|
||||||
|
|
||||||
|
def checkPathAndValue(self, line, expectedPath, expectedValue):
|
||||||
result = self.parser.splitToPathAndValue(line)
|
result = self.parser.splitToPathAndValue(line)
|
||||||
|
|
||||||
self.assertEqual('abc.123.some_name', result[0])
|
self.assertEqual(expectedPath, result[0])
|
||||||
self.assertEqual('crazy value ±~ ../ 123', result[1])
|
self.assertEqual(expectedValue, result[1])
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
import unittest
|
import unittest
|
||||||
|
from Core.LineConveyor.NullPreprocessor import NullPreprocessor
|
||||||
from parsers.SettingsParser.SettingsParser import SettingsParser
|
from parsers.SettingsParser.SettingsParser import SettingsParser
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestSettingsParser(unittest.TestCase):
|
class TestSettingsParser(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.parser = SettingsParser()
|
self.preprocessor = NullPreprocessor()
|
||||||
|
self.parser = SettingsParser(self.preprocessor, None)
|
||||||
|
|
||||||
def test_processLine(self):
|
def test_processLine(self):
|
||||||
line1 = "x.y.name1 = 'value1'"
|
line1 = "x.y.name1 = 'value1'"
|
||||||
|
|
@ -38,15 +41,16 @@ class TestSettingsParser(unittest.TestCase):
|
||||||
self.assertEqual('value8', self.parser.settings['a']['z']['name2'])
|
self.assertEqual('value8', self.parser.settings['a']['z']['name2'])
|
||||||
|
|
||||||
def test_emptyLinesAndComments(self):
|
def test_emptyLinesAndComments(self):
|
||||||
|
|
||||||
class PartialSettingsParser(SettingsParser):
|
class PartialSettingsParser(SettingsParser):
|
||||||
def __init__(self):
|
def __init__(self, textPreprocessor):
|
||||||
SettingsParser.__init__(self)
|
SettingsParser.__init__(self, textPreprocessor, None)
|
||||||
self.processLineCall = 0
|
self.processLineCall = 0
|
||||||
|
|
||||||
def processLine(self, line):
|
def processLine(self, line):
|
||||||
self.processLineCall += 1
|
self.processLineCall += 1
|
||||||
|
|
||||||
self.parser = PartialSettingsParser()
|
self.parser = PartialSettingsParser(self.preprocessor)
|
||||||
content = """
|
content = """
|
||||||
valid.line.with.setting = 'some value'
|
valid.line.with.setting = 'some value'
|
||||||
# this is comment
|
# this is comment
|
||||||
|
|
@ -56,7 +60,9 @@ valid.line.with.setting = 'some value'
|
||||||
|
|
||||||
self.parser.parse(content)
|
self.parser.parse(content)
|
||||||
|
|
||||||
self.assertEqual(2, self.parser.processLineCall)
|
# всего 6 строк, 2 из которых пустые
|
||||||
|
# NullPreprocessor не уберет комментарии, поэтому будет 4 вызова processLine
|
||||||
|
self.assertEqual(4, self.parser.processLineCall)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'rzaitov'
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
import unittest
|
||||||
|
from commands.ShellCommandBase import ShellCommandBase
|
||||||
|
|
||||||
|
|
||||||
|
class MyShellCommand(ShellCommandBase):
|
||||||
|
def __init__(self, execWithError=False):
|
||||||
|
ShellCommandBase.__init__(self)
|
||||||
|
self.execWithError = execWithError
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
cmdText = 'exit 1' if self.execWithError else 'exit 0'
|
||||||
|
self.executeShell(cmdText)
|
||||||
|
|
||||||
|
|
||||||
|
class TestShellCommand(unittest.TestCase):
|
||||||
|
def test_noError(self):
|
||||||
|
cmd = MyShellCommand(execWithError=False)
|
||||||
|
cmd.execute()
|
||||||
|
|
||||||
|
def test_withError(self):
|
||||||
|
cmd = MyShellCommand(execWithError=True)
|
||||||
|
|
||||||
|
with self.assertRaises(Exception):
|
||||||
|
cmd.execute()
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'rzaitov'
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
import unittest
|
||||||
|
from utils.ManifestPatcher import ManifestPatcher
|
||||||
|
|
||||||
|
|
||||||
|
class TestManifestPatcher(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.patcher = ManifestPatcher('somePath')
|
||||||
|
|
||||||
|
def test_parseRawName(self):
|
||||||
|
nameInfo1 = self.patcher.parseRawName('simpleName')
|
||||||
|
self.assertEqual(None, nameInfo1['prefix'])
|
||||||
|
self.assertEqual('simpleName', nameInfo1['original_name'])
|
||||||
|
|
||||||
|
nameInfo2 = self.patcher.parseRawName('prefix:originalName')
|
||||||
|
self.assertEqual('prefix', nameInfo2['prefix'])
|
||||||
|
self.assertEqual('originalName', nameInfo2['original_name'])
|
||||||
|
|
||||||
|
def test_fetchName(self):
|
||||||
|
nameInfo = {
|
||||||
|
'prefix': 'android',
|
||||||
|
'original_name': 'MyName'
|
||||||
|
}
|
||||||
|
|
||||||
|
name = self.patcher.fetchName(nameInfo)
|
||||||
|
self.assertEqual('{http://schemas.android.com/apk/res/android}MyName', name)
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import unittest
|
||||||
|
from utils.XmlPatcher import XmlPatcher
|
||||||
|
|
||||||
|
|
||||||
|
class TestXmlPatcher(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.patcher = XmlPatcher('somePath')
|
||||||
|
|
||||||
|
def test_getNameWithNs(self):
|
||||||
|
name = self.patcher.getNameWithNs('OriginalName', 'http://namespace')
|
||||||
|
self.assertEqual('{http://namespace}OriginalName', name)
|
||||||
|
|
@ -1,10 +1,17 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
|
|
||||||
|
|
||||||
class BaseBackupCommand:
|
class BaseBackupCommand(CommandBase):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackup):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
|
assert ignoreBackup is not None
|
||||||
|
|
||||||
|
self.backupIgnore = ['.git', '.gitignore', '.DS_Store', 'backup']
|
||||||
|
self.backupIgnore.extend(ignoreBackup)
|
||||||
|
|
||||||
self.folderPath = '.'
|
self.folderPath = '.'
|
||||||
|
|
||||||
# вычислять абсолютные пути надо на этапе создания комманды
|
# вычислять абсолютные пути надо на этапе создания комманды
|
||||||
|
|
@ -12,7 +19,6 @@ class BaseBackupCommand:
|
||||||
self.srcAbsDirPath = self.getAbsSrc()
|
self.srcAbsDirPath = self.getAbsSrc()
|
||||||
self.backupDirAbsPath = self.getAbsDst()
|
self.backupDirAbsPath = self.getAbsDst()
|
||||||
|
|
||||||
self.backupIgnore = ['.git', '.gitignore', '.DS_Store', 'backup']
|
|
||||||
|
|
||||||
def getAbsSrc(self):
|
def getAbsSrc(self):
|
||||||
return self.getAbs(self.folderPath)
|
return self.getAbs(self.folderPath)
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,18 @@ from commands.BaseBackupCommand.BaseBackupCommand import BaseBackupCommand
|
||||||
|
|
||||||
|
|
||||||
class CreateBackupCommand(BaseBackupCommand):
|
class CreateBackupCommand(BaseBackupCommand):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackup):
|
||||||
BaseBackupCommand.__init__(self)
|
BaseBackupCommand.__init__(self, ignoreBackup)
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
if os.path.exists(self.backupDirAbsPath):
|
#if os.path.exists(self.backupDirAbsPath):
|
||||||
raise Exception('folder: {0} already exists'.format(self.backupDirAbsPath))
|
# raise Exception('folder: {0} already exists'.format(self.backupDirAbsPath))
|
||||||
|
|
||||||
dirContent = os.listdir(self.srcAbsDirPath)
|
dirContent = os.listdir(self.srcAbsDirPath)
|
||||||
|
|
||||||
|
if os.path.exists(self.backupDirAbsPath):
|
||||||
|
shutil.rmtree(self.backupDirAbsPath)
|
||||||
|
|
||||||
os.mkdir(self.backupDirAbsPath)
|
os.mkdir(self.backupDirAbsPath)
|
||||||
|
|
||||||
for fileOrDir in dirContent:
|
for fileOrDir in dirContent:
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ from commands.BaseBackupCommand.BaseBackupCommand import BaseBackupCommand
|
||||||
|
|
||||||
|
|
||||||
class DeleteBackupCommand(BaseBackupCommand):
|
class DeleteBackupCommand(BaseBackupCommand):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackup):
|
||||||
BaseBackupCommand.__init__(self)
|
BaseBackupCommand.__init__(self, ignoreBackup)
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
if not os.path.exists(self.backupDirAbsPath):
|
if not os.path.exists(self.backupDirAbsPath):
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ from commands.BaseBackupCommand.BaseBackupCommand import BaseBackupCommand
|
||||||
|
|
||||||
|
|
||||||
class RestoreBackupCommand(BaseBackupCommand):
|
class RestoreBackupCommand(BaseBackupCommand):
|
||||||
def __init__(self):
|
def __init__(self, ignoreBackup):
|
||||||
BaseBackupCommand.__init__(self)
|
BaseBackupCommand.__init__(self, ignoreBackup)
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
if not os.path.exists(self.backupDirAbsPath):
|
if not os.path.exists(self.backupDirAbsPath):
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
from subprocess import call
|
from commands.ShellCommandBase import ShellCommandBase
|
||||||
|
|
||||||
|
|
||||||
class CleanBuildCommandBase:
|
class CleanBuildCommandBase(ShellCommandBase):
|
||||||
def __init__(self, commandPattern, pathToBuildUtil, slnPath, slnConfig):
|
def __init__(self, commandPattern, pathToBuildUtil, slnPath, slnConfig):
|
||||||
|
ShellCommandBase.__init__(self)
|
||||||
|
|
||||||
assert commandPattern is not None
|
assert commandPattern is not None
|
||||||
assert pathToBuildUtil is not None
|
assert pathToBuildUtil is not None
|
||||||
assert slnPath is not None
|
assert slnPath is not None
|
||||||
|
|
@ -15,4 +17,5 @@ class CleanBuildCommandBase:
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
cmdText = self.__commandPattern.format(self.__pathToBuildUtil, self.__slnConfig, self.__slnPath)
|
cmdText = self.__commandPattern.format(self.__pathToBuildUtil, self.__slnConfig, self.__slnPath)
|
||||||
call(cmdText, shell=True)
|
|
||||||
|
self.executeShell(cmdText)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
from commands.ShellCommandBase import ShellCommandBase
|
||||||
|
|
||||||
|
|
||||||
|
class SignApkCommand(ShellCommandBase):
|
||||||
|
def __init__(self, pathToBuildUtil, slnPath, slnConfig, projectName):
|
||||||
|
ShellCommandBase.__init__(self)
|
||||||
|
|
||||||
|
assert pathToBuildUtil is not None
|
||||||
|
assert slnPath is not None
|
||||||
|
assert slnConfig is not None
|
||||||
|
assert projectName is not None
|
||||||
|
|
||||||
|
self.pathToBuildUtil = pathToBuildUtil
|
||||||
|
self.slnPath = slnPath
|
||||||
|
self.slnConfig = slnConfig
|
||||||
|
self.projectName = projectName
|
||||||
|
|
||||||
|
self.commandPattern = '{0} -v build "--configuration:{1}" "--project:{2}" /t:SignAndroidPackage "{3}"'
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
cmdText = self.commandPattern.format(self.pathToBuildUtil, self.slnConfig, self.projectName, self.slnPath)
|
||||||
|
print cmdText
|
||||||
|
self.executeShell(cmdText)
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import abc
|
||||||
|
|
||||||
|
|
||||||
|
class CommandBase(object):
|
||||||
|
__metaclass__ = abc.ABCMeta
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def execute(self):
|
||||||
|
pass
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
|
|
||||||
class CopyCommand:
|
|
||||||
|
class CopyCommand(CommandBase):
|
||||||
def __init__(self, copyArguments):
|
def __init__(self, copyArguments):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
assert copyArguments is not None
|
assert copyArguments is not None
|
||||||
|
|
||||||
self.__copyArguments = copyArguments
|
self.__copyArguments = copyArguments
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
from commands.ShCommand import ShCommand
|
from commands.ShTextCommand import ShTextCommand
|
||||||
|
|
||||||
|
|
||||||
class MakeDirsCommand:
|
class MakeDirsCommand(ShTextCommand):
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
assert path is not None
|
assert path is not None
|
||||||
|
self.path = path
|
||||||
|
|
||||||
self.__path = path
|
cmdText = "mkdir -p '{0}'".format(self.path)
|
||||||
|
ShTextCommand.__init__(self, cmdText)
|
||||||
def execute(self):
|
|
||||||
cmdText = "mkdir -p '{0}'".format(self.__path)
|
|
||||||
innerCommand = ShCommand(cmdText)
|
|
||||||
innerCommand.execute()
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
import utils.CsprojPatcher as csproj
|
import utils.CsprojPatcher as csproj
|
||||||
|
|
||||||
class PatchCsprojCommand():
|
class PatchCsprojCommand(CommandBase):
|
||||||
def __init__(self, csprojAbsPath, key, value, slnConfig):
|
def __init__(self, csprojAbsPath, key, value, slnConfig):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
assert csprojAbsPath is not None
|
assert csprojAbsPath is not None
|
||||||
assert key is not None
|
assert key is not None
|
||||||
assert value is not None
|
assert value is not None
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
from utils.InfoPlistPatcher import InfoPlistPatcher
|
from utils.InfoPlistPatcher import InfoPlistPatcher
|
||||||
|
|
||||||
|
|
||||||
class PatchInfoPlistCommand():
|
class PatchInfoPlistCommand(CommandBase):
|
||||||
def __init__(self, pathToPlist, key, value):
|
def __init__(self, pathToPlist, key, value):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
assert pathToPlist is not None
|
assert pathToPlist is not None
|
||||||
assert key is not None
|
assert key is not None
|
||||||
assert value is not None
|
assert value is not None
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
|
from utils.ManifestPatcher import ManifestPatcher
|
||||||
|
|
||||||
|
|
||||||
|
class PatchManifestCommand(CommandBase):
|
||||||
|
def __init__(self, pathToManifest, key, value):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
|
assert pathToManifest is not None
|
||||||
|
assert key is not None
|
||||||
|
assert value is not None
|
||||||
|
|
||||||
|
self.pathToManifest = pathToManifest
|
||||||
|
self.key = key
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
patcher = ManifestPatcher(self.pathToManifest)
|
||||||
|
|
||||||
|
patcher.AddOrReplaceManifestAtr(self.key, self.value)
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
from utils.SlnPatcher import SlnPatcher
|
from utils.SlnPatcher import SlnPatcher
|
||||||
|
|
||||||
|
|
||||||
class RemoveProjectCommand:
|
class RemoveProjectCommand(CommandBase):
|
||||||
def __init__(self, slnPath, projectName):
|
def __init__(self, slnPath, projectNames):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
assert slnPath is not None
|
assert slnPath is not None
|
||||||
assert projectName is not None
|
assert projectNames is not None
|
||||||
|
|
||||||
self.__slnPath = slnPath
|
self.__slnPath = slnPath
|
||||||
self.__projectName = projectName
|
self.projectNames = projectNames
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
patcher = SlnPatcher(self.__slnPath)
|
patcher = SlnPatcher(self.__slnPath)
|
||||||
patcher.removeProjects([self.__projectName])
|
patcher.removeProjects(self.projectNames)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
from subprocess import call
|
|
||||||
|
|
||||||
|
|
||||||
class ShCommand:
|
|
||||||
def __init__(self, commandText):
|
|
||||||
assert commandText is not None
|
|
||||||
|
|
||||||
self.__commandText = commandText
|
|
||||||
|
|
||||||
def execute(self):
|
|
||||||
call(self.__commandText, shell=True)
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
from commands.ShellCommandBase import ShellCommandBase
|
||||||
|
|
||||||
|
|
||||||
|
class ShTextCommand(ShellCommandBase):
|
||||||
|
def __init__(self, commandText):
|
||||||
|
ShellCommandBase.__init__(self)
|
||||||
|
assert commandText is not None
|
||||||
|
|
||||||
|
self.commandText = commandText
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
self.executeShell(self.commandText)
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
|
from subprocess import call
|
||||||
|
|
||||||
|
|
||||||
|
class ShellCommandBase(CommandBase):
|
||||||
|
def __init__(self):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
|
def executeShell(self, commandText):
|
||||||
|
assert commandText is not None
|
||||||
|
|
||||||
|
retCode = call(commandText, shell=True)
|
||||||
|
|
||||||
|
if retCode != 0:
|
||||||
|
msg = 'problem with shell command: {0}'.format(commandText)
|
||||||
|
raise Exception(msg)
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
|
from commands.CommandBase import CommandBase
|
||||||
from utils.TestflightPublisher import TestFlightPublisher
|
from utils.TestflightPublisher import TestFlightPublisher
|
||||||
|
|
||||||
|
|
||||||
class TestflightCommand:
|
class TestflightCommand(CommandBase):
|
||||||
def __init__(self, pathToFile, api_token, team_token, notes):
|
def __init__(self, pathToFile, api_token, team_token, notes):
|
||||||
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
assert pathToFile is not None
|
assert pathToFile is not None
|
||||||
|
|
||||||
self.__pathToFile = pathToFile
|
self.__pathToFile = pathToFile
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from parsers.LineParser import LineParser
|
from parsers.LineParser import LineParser
|
||||||
|
from parsers.RegexpBuilder import RegexpBuilder
|
||||||
|
|
||||||
|
|
||||||
class CleanBuildParser(LineParser):
|
class CleanBuildParser(LineParser):
|
||||||
|
|
@ -8,7 +9,7 @@ class CleanBuildParser(LineParser):
|
||||||
LineParser.__init__(self)
|
LineParser.__init__(self)
|
||||||
assert commandToken is not None
|
assert commandToken is not None
|
||||||
|
|
||||||
self.__commandToken = commandToken
|
self.commandToken = commandToken
|
||||||
|
|
||||||
def parseLine(self, line):
|
def parseLine(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
@ -16,7 +17,8 @@ class CleanBuildParser(LineParser):
|
||||||
filePathRegexp = r"'(?P<path>[./ a-zA-Z]+\.sln)'"
|
filePathRegexp = r"'(?P<path>[./ a-zA-Z]+\.sln)'"
|
||||||
slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'$"
|
slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'$"
|
||||||
|
|
||||||
regexpSource = self.startsWith(self.__commandToken) + filePathRegexp + self.keywordToken('for') + slnConfigRegexp
|
rb = RegexpBuilder()
|
||||||
|
regexpSource = rb.startsWith(self.commandToken) + filePathRegexp + rb.keywordToken('for') + slnConfigRegexp
|
||||||
regexp = re.compile(regexpSource, re.UNICODE)
|
regexp = re.compile(regexpSource, re.UNICODE)
|
||||||
|
|
||||||
match = regexp.match(line)
|
match = regexp.match(line)
|
||||||
|
|
@ -30,5 +32,5 @@ class CleanBuildParser(LineParser):
|
||||||
def isValidLine(self, line):
|
def isValidLine(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
isValid = line.startswith(self.__commandToken)
|
isValid = line.startswith(self.commandToken)
|
||||||
return isValid
|
return isValid
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import re
|
||||||
|
|
||||||
from parsers.CopyParser.CopyArguments import CopyArguments
|
from parsers.CopyParser.CopyArguments import CopyArguments
|
||||||
from parsers.LineParser import LineParser
|
from parsers.LineParser import LineParser
|
||||||
|
from parsers.RegexpBuilder import RegexpBuilder
|
||||||
|
|
||||||
|
|
||||||
class CopyLineParser(LineParser):
|
class CopyLineParser(LineParser):
|
||||||
|
|
@ -15,7 +16,8 @@ class CopyLineParser(LineParser):
|
||||||
srcFileNameRegexp = r"'(?P<src>[^']+)'"
|
srcFileNameRegexp = r"'(?P<src>[^']+)'"
|
||||||
dstFileNameRegexp = r"'(?P<dst>[^']+)'$"
|
dstFileNameRegexp = r"'(?P<dst>[^']+)'$"
|
||||||
|
|
||||||
regexpSource = self.startsWith('copy') + srcFileNameRegexp + self.keywordToken('to') + dstFileNameRegexp
|
rb = RegexpBuilder()
|
||||||
|
regexpSource = rb.startsWith('copy') + srcFileNameRegexp + rb.keywordToken('to') + dstFileNameRegexp
|
||||||
regexp = re.compile(regexpSource, re.UNICODE)
|
regexp = re.compile(regexpSource, re.UNICODE)
|
||||||
|
|
||||||
match = regexp.match(line)
|
match = regexp.match(line)
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,14 @@
|
||||||
import re
|
import re
|
||||||
|
from parsers.InsideParser.InsideParserBase import InsideParserBase
|
||||||
from parsers.LineParser import LineParser
|
from parsers.RegexpBuilder import RegexpBuilder
|
||||||
|
|
||||||
|
|
||||||
class InsideCsprojSetParser(LineParser):
|
class InsideCsprojSetParser(InsideParserBase):
|
||||||
def __init__(self, fileExt):
|
def __init__(self, fileExt):
|
||||||
LineParser.__init__(self)
|
InsideParserBase.__init__(self, fileExt)
|
||||||
|
|
||||||
self.__extension = fileExt
|
|
||||||
|
|
||||||
def parseLine(self, line):
|
def parseLine(self, line):
|
||||||
assert line is not None
|
match = self.fetchMatchFor(line)
|
||||||
|
|
||||||
matchInfo = self.getMatchInfo(line)
|
|
||||||
match = matchInfo[0]
|
|
||||||
regexpSource = matchInfo[1]
|
|
||||||
self._guardMatch(match, line, regexpSource)
|
|
||||||
|
|
||||||
filePath = match.group('file')
|
filePath = match.group('file')
|
||||||
key = match.group('key')
|
key = match.group('key')
|
||||||
|
|
@ -27,22 +20,14 @@ class InsideCsprojSetParser(LineParser):
|
||||||
def getMatchInfo(self, line):
|
def getMatchInfo(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
filePathRegexp = r"'(?P<file>[./ a-zA-Z]+\.{0})'".format(self.__extension)
|
|
||||||
keyRegexp = r'(?P<key>[a-zA-Z]+)'
|
keyRegexp = r'(?P<key>[a-zA-Z]+)'
|
||||||
valueRegexp = r"'(?P<value>[^']+)'"
|
valueRegexp = r"'(?P<value>[^']+)'"
|
||||||
slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'$"
|
slnConfigRegexp = r"'(?P<config>[a-zA-Z|]*)'$"
|
||||||
|
|
||||||
regexpSource = self.startsWith('inside') + filePathRegexp + self.keywordToken('set') + keyRegexp + \
|
rb = RegexpBuilder()
|
||||||
self.keywordToken('to') + valueRegexp + self.keywordToken('for') + slnConfigRegexp
|
regexpSource = rb.startsWith('inside') + self.filePathRegexp + rb.keywordToken('set') + keyRegexp + \
|
||||||
|
rb.keywordToken('to') + valueRegexp + rb.keywordToken('for') + slnConfigRegexp
|
||||||
regexp = re.compile(regexpSource, re.UNICODE)
|
regexp = re.compile(regexpSource, re.UNICODE)
|
||||||
|
|
||||||
match = regexp.match(line)
|
match = regexp.match(line)
|
||||||
return match, regexpSource
|
return match, regexpSource
|
||||||
|
|
||||||
def isValidLine(self, line):
|
|
||||||
assert line is not None
|
|
||||||
|
|
||||||
matchInfo = self.getMatchInfo(line)
|
|
||||||
match = matchInfo[0]
|
|
||||||
|
|
||||||
return match is not None
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
import abc
|
||||||
|
from parsers.LineParser import LineParser
|
||||||
|
|
||||||
|
|
||||||
|
class InsideParserBase(LineParser):
|
||||||
|
def __init__(self, fileExt):
|
||||||
|
LineParser.__init__(self)
|
||||||
|
|
||||||
|
assert fileExt is not None
|
||||||
|
self.fileExt = fileExt
|
||||||
|
self.filePathRegexp = r"'(?P<file>[./ a-zA-Z]+\.{0})'".format(self.fileExt)
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def getMatchInfo(self, line):
|
||||||
|
# "Not implemented"
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
def fetchMatchFor(self, text):
|
||||||
|
assert text is not None
|
||||||
|
|
||||||
|
matchInfo = self.getMatchInfo(text)
|
||||||
|
match = matchInfo[0]
|
||||||
|
regexpSource = matchInfo[1]
|
||||||
|
|
||||||
|
self._guardMatch(match, text, regexpSource)
|
||||||
|
|
||||||
|
return match
|
||||||
|
|
||||||
|
|
||||||
|
def isValidLine(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
matchInfo = self.getMatchInfo(line)
|
||||||
|
match = matchInfo[0]
|
||||||
|
|
||||||
|
return match is not None
|
||||||
|
|
@ -1,35 +1,44 @@
|
||||||
import re
|
import re
|
||||||
|
from parsers.InsideParser.InsideParserBase import InsideParserBase
|
||||||
from parsers.LineParser import LineParser
|
from parsers.RegexpBuilder import RegexpBuilder
|
||||||
|
from parsers.ValuesStriper import ValuesStripper
|
||||||
|
|
||||||
|
|
||||||
class InsideRemoveParser(LineParser):
|
class InsideRemoveParser(InsideParserBase):
|
||||||
def __init__(self, fileExt):
|
def __init__(self, fileExt):
|
||||||
LineParser.__init__(self)
|
InsideParserBase.__init__(self, fileExt)
|
||||||
assert fileExt is not None
|
|
||||||
|
|
||||||
self.__extension = fileExt
|
|
||||||
|
|
||||||
def parseLine(self, line):
|
def parseLine(self, line):
|
||||||
|
match = self.fetchMatchFor(line)
|
||||||
|
|
||||||
|
filePath = match.group('file')
|
||||||
|
projectNames = match.group('projects')
|
||||||
|
|
||||||
|
names = self.parseNames(projectNames)
|
||||||
|
result = {
|
||||||
|
'file_path': filePath,
|
||||||
|
'names': names
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def getMatchInfo(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
filePathRegexp = r"'(?P<file>[./ a-zA-Z]+\.{0})'".format(self.__extension)
|
filePathRegexp = r"'(?P<file>[./ a-zA-Z]+\.{0})'".format(self.fileExt)
|
||||||
projectNameRegexp = r'(?P<project>[.a-zA-Z]+)'
|
projectNameRegexp = r"'(?P<projects>[^']+)'"
|
||||||
|
|
||||||
regexpSource = self.startsWith('inside') + filePathRegexp + self.keywordToken('remove') + projectNameRegexp + self.spaceEndsWith('project')
|
rb = RegexpBuilder()
|
||||||
|
regexpSource = rb.startsWith('inside') + filePathRegexp + rb.keywordToken('remove') + projectNameRegexp + \
|
||||||
|
rb.spaceEndsWith('project(s)?')
|
||||||
regexp = re.compile(regexpSource, re.UNICODE)
|
regexp = re.compile(regexpSource, re.UNICODE)
|
||||||
|
|
||||||
match = regexp.match(line)
|
match = regexp.match(line)
|
||||||
self._guardMatch(match, line, regexpSource)
|
return match, regexpSource
|
||||||
|
|
||||||
filePath = match.group('file')
|
def parseNames(self, namesStr):
|
||||||
projectName = match.group('project')
|
|
||||||
|
|
||||||
return filePath, projectName
|
vs = ValuesStripper()
|
||||||
|
names = vs.strip(namesStr)
|
||||||
|
|
||||||
def isValidLine(self, line):
|
return names
|
||||||
regexpSrc = r"inside\s+'[./ a-zA-Z]+\.{0}'\s+remove".format(self.__extension)
|
|
||||||
regexp = re.compile(regexpSrc, re.UNICODE)
|
|
||||||
|
|
||||||
match = regexp.match(line)
|
|
||||||
return match is not None
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
import re
|
||||||
|
from parsers.InsideParser.InsideParserBase import InsideParserBase
|
||||||
|
from parsers.RegexpBuilder import RegexpBuilder
|
||||||
|
from parsers.ValuesStriper import ValuesStripper
|
||||||
|
|
||||||
|
|
||||||
|
class InsideSetArrayParser(InsideParserBase):
|
||||||
|
def __init__(self, fileExt):
|
||||||
|
InsideParserBase.__init__(self, fileExt)
|
||||||
|
|
||||||
|
self.values = None
|
||||||
|
|
||||||
|
def parseLine(self, line):
|
||||||
|
match = self.fetchMatchFor(line)
|
||||||
|
|
||||||
|
filePath = match.group('file')
|
||||||
|
key = match.group('key')
|
||||||
|
valuesStr = match.group('values')
|
||||||
|
|
||||||
|
self.values = self.parseValues(valuesStr)
|
||||||
|
|
||||||
|
return filePath, key, valuesStr
|
||||||
|
|
||||||
|
def getMatchInfo(self, line):
|
||||||
|
assert line is not None
|
||||||
|
|
||||||
|
keyRegexp = r'(?P<key>[a-zA-Z]+)'
|
||||||
|
valueRegexp = r"'(?P<values>[^']+)'$"
|
||||||
|
|
||||||
|
rb = RegexpBuilder()
|
||||||
|
regexpSource = rb.startsWith('inside') + self.filePathRegexp + rb.keywordToken('set') + keyRegexp + \
|
||||||
|
rb.keywordToken('with') + rb.than('values') + valueRegexp
|
||||||
|
regexp = re.compile(regexpSource, re.UNICODE)
|
||||||
|
|
||||||
|
match = regexp.match(line)
|
||||||
|
|
||||||
|
return match, regexpSource
|
||||||
|
|
||||||
|
def parseValues(self, valuesStr):
|
||||||
|
assert valuesStr is not None
|
||||||
|
assert len(valuesStr) > 0
|
||||||
|
|
||||||
|
vs = ValuesStripper()
|
||||||
|
values = vs.strip(valuesStr)
|
||||||
|
|
||||||
|
return values
|
||||||
|
|
@ -1,20 +1,14 @@
|
||||||
import re
|
import re
|
||||||
|
from parsers.InsideParser.InsideParserBase import InsideParserBase
|
||||||
from parsers.LineParser import LineParser
|
from parsers.RegexpBuilder import RegexpBuilder
|
||||||
|
|
||||||
|
|
||||||
class InsideSetParser(LineParser):
|
class InsideSetParser(InsideParserBase):
|
||||||
def __init__(self, fileExt):
|
def __init__(self, fileExt):
|
||||||
LineParser.__init__(self)
|
InsideParserBase.__init__(self, fileExt)
|
||||||
self.__extension = fileExt
|
|
||||||
|
|
||||||
def parseLine(self, line):
|
def parseLine(self, line):
|
||||||
assert line is not None
|
match = self.fetchMatchFor(line)
|
||||||
|
|
||||||
matchInfo = self.getMatchInfo(line)
|
|
||||||
match = matchInfo[0]
|
|
||||||
regexpSource = matchInfo[1]
|
|
||||||
self._guardMatch(match, line, regexpSource)
|
|
||||||
|
|
||||||
filePath = match.group('file')
|
filePath = match.group('file')
|
||||||
key = match.group('key')
|
key = match.group('key')
|
||||||
|
|
@ -25,21 +19,14 @@ class InsideSetParser(LineParser):
|
||||||
def getMatchInfo(self, line):
|
def getMatchInfo(self, line):
|
||||||
assert line is not None
|
assert line is not None
|
||||||
|
|
||||||
filePathRegexp = r"'(?P<file>[./ a-zA-Z]+\.{0})'".format(self.__extension)
|
keyRegexp = r'(?P<key>\S+)'
|
||||||
keyRegexp = r'(?P<key>[a-zA-Z]+)'
|
|
||||||
valueRegexp = r"'(?P<value>[^']+)'$"
|
valueRegexp = r"'(?P<value>[^']+)'$"
|
||||||
|
|
||||||
regexpSource = self.startsWith('inside') + filePathRegexp + self.keywordToken('set') + keyRegexp + \
|
rb = RegexpBuilder()
|
||||||
self.keywordToken('to') + valueRegexp
|
regexpSource = rb.startsWith('inside') + self.filePathRegexp + rb.keywordToken('set') + keyRegexp + \
|
||||||
|
rb.keywordToken('to') + valueRegexp
|
||||||
regexp = re.compile(regexpSource, re.UNICODE)
|
regexp = re.compile(regexpSource, re.UNICODE)
|
||||||
|
|
||||||
match = regexp.match(line)
|
match = regexp.match(line)
|
||||||
|
|
||||||
return match, regexpSource
|
return match, regexpSource
|
||||||
|
|
||||||
def isValidLine(self, line):
|
|
||||||
assert line is not None
|
|
||||||
|
|
||||||
matchInfo = self.getMatchInfo(line)
|
|
||||||
match = matchInfo[0]
|
|
||||||
return match is not None
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue