Skip to content

Commit

Permalink
Merge 0.9.10.0 to Master
Browse files Browse the repository at this point in the history
  • Loading branch information
linvi committed Oct 14, 2015
2 parents 166722a + 57937fa commit 3ceb0a2
Show file tree
Hide file tree
Showing 541 changed files with 41,766 additions and 1,359 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.pdb
*.dll
*.xml
*.cache
*.dll.config
*.FileListAbsolute
*/obj
*/bin
*.exe
/.vs
/packages
/Developer Tools/temp*
/Developer Tools/TweetinviAPI/lib
/Examplinvi.Web/App_Data
*.zip
8 changes: 0 additions & 8 deletions Developer Tools/README - Signing - pfx.txt

This file was deleted.

31 changes: 30 additions & 1 deletion Developer Tools/README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
**********************************************************
****************** CONFIGURE MACHINE *********************
**********************************************************


Install PowerShell Community Extensions to get the Write-Zip command

Add the PowerShell.Exe.Config to C:\Windows\System32\WindowsPowerShell\v1.0
Run : Set-ExecutionPolicy RemoteSigned

Restart the machine (pscx cannot be used otherwise)
Restart the machine (pscx cannot be used otherwise)


**********************************************************
************************ NUGET ***************************
**********************************************************


nuget pack
nuget push <*.nupkg> -ApiKey 'MY_NUGET.ORG_APIKEY' -Verbosity detailed


**********************************************************
********************** VS SIGNING ************************
**********************************************************


Open Visual Studio Command Prompt

// Generate the public Key file
sn -p tweetinvi.pfx tweetinvi.key

// Get the Hexa version of the public key
// When performing this action the password should be requested
sn -tp tweetinvi.key
148 changes: 84 additions & 64 deletions Developer Tools/Tweetinvi.Builder.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$version='0.9.9.6'
Param([Switch]$uv);

$version='0.9.10.0'
$assemblyinfoLocation = 'Properties\assemblyinfo.cs'
$rootPath = '..\'
$releaseMode = 'Release' # vs. 'Debug'
Expand All @@ -10,6 +12,9 @@ $net45PortableFolder = '.\TweetinviAPI\lib\portable-net45+wp80+win8+wpa81+dnxcor
$tweetinviAPIMerged = 'TweetinviAPI.dll'

$examplinvi = 'Examplinvi'
$examplinviUniversalApp = 'Examplinvi.UniversalApp'
$examplinviWeb = 'Examplinvi.Web'

$testinvi = 'Testinvi'
$tweetinvi = 'Tweetinvi'
$tweetinviSecurity = 'Tweetinvi.Security'
Expand All @@ -25,6 +30,8 @@ $projects =
@(
# Other projects
$examplinvi,
$examplinviUniversalApp,
$examplinviWeb,
$testinvi,

# Tweetinvi API
Expand Down Expand Up @@ -75,68 +82,81 @@ for ($i=0; $i -lt $projects.length; $i++)
Get-Item $filePath | .\Replace-Regex.ps1 -Pattern $replaceAssemblyFileVersionRegex -Replacement $replaceAssemblyFileVersion -overwrite
}

# Build solution
Build $rootPath'Tweetinvi.sln' $releaseMode

# Create temporary folder
If (Test-Path $temporaryFolder)
{
Remove-Item $temporaryFolder\*
}
Else
{
mkdir $temporaryFolder
}

# Move dll into temporary folder
$examplinviBin = $rootPath + $examplinvi + '\bin\' + $releaseMode

Get-ChildItem -LiteralPath $examplinviBin -filter *.dll | % { Copy-Item $_.fullname $temporaryFolder }

Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net40Folder }
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net45Folder }
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net40PortableFolder }
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net45PortableFolder }

Copy-Item $rootPath$examplinvi\Program.cs $temporaryFolder\Cheatsheet.cs

# Create Merged assembly
$ILMergeCommand = '.\ILMerge.exe /target:library /out:' + $temporaryFolder + '/' + $tweetinviAPIMerged + ' '

for ($i=0; $i -lt $additionalAssemblies.length; $i++)
{
$ILMergeCommand = $ILMergeCommand + $temporaryFolder + '/' + $additionalAssemblies[$i] + ' '
}

for ($i=2; $i -lt $projects.length; $i++)
{
$ILMergeCommand = $ILMergeCommand + $temporaryFolder + '/' + $projects[$i] + '.dll '
}

Write-Host $ILMergeCommand
Invoke-Expression $ILMergeCommand

# Create Zip files
$tweetinviBinariesPackage = 'Tweetinvi ' + $version + ' - Binaries.zip'
$tweetinviMergedBinariesPackage = 'Tweetinvi ' + $version + ' - Merged Binaries.zip'

Write-Zip -OutputPath $tweetinviBinariesPackage (dir $temporaryFolder)
Write-Zip -OutputPath $tweetinviMergedBinariesPackage (ls $temporaryFolder\$tweetinviAPIMerged, $temporaryFolder\Cheatsheet.cs)

#Cleanup
rm DTAR_*
rm -r .\obj
$answer = Read-Host "Do you want to cleanup the temporary files? (y/n)"

while("y", "yes", "n", "no" -notcontains $answer)
{
$answer = Read-Host "Yes or No"
}

if ($answer -eq "y" -or $answer -eq "yes")
{
Remove-Item $temporaryFolder -Force -Recurse
Write-Host Temporary files successfully removed!
$filePath = $rootPath + $tweetinviWebLogic + '\TwitterClientHandler.cs';
Get-Item $filePath | .\Replace-Regex.ps1 -Pattern '"Tweetinvi/(?<versionNumber>\d+(\.\d+)*)(.x)?"' -Replacement ('"Tweetinvi/' + $version + '"') -overwrite


if (!$uv.IsPresent) {
# Build solution
Build $rootPath'Tweetinvi.sln' $releaseMode

# Create temporary folder
If (Test-Path $temporaryFolder)
{
Remove-Item $temporaryFolder\*
}
Else
{
mkdir $temporaryFolder
}

# Move dll into temporary folder
$examplinviBin = $rootPath + $examplinvi + '\bin\' + $releaseMode

Get-ChildItem -LiteralPath $examplinviBin -filter *.dll | % { Copy-Item $_.fullname $temporaryFolder }

# Ensure the nuget folders have been created
mkdir $net40Folder -Force | Out-Null
mkdir $net45Folder -Force | Out-Null
mkdir $net40PortableFolder -Force | Out-Null
mkdir $net45PortableFolder -Force | Out-Null

# Add .dll into nuget folders
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net40Folder }
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net45Folder }
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net40PortableFolder }
Get-ChildItem -LiteralPath $examplinviBin -filter Tweetinvi*.dll | % { Copy-Item $_.fullname $net45PortableFolder }

Copy-Item $rootPath$examplinvi\Program.cs $temporaryFolder\Cheatsheet.cs

# Create Merged assembly
$ILMergeCommand = '.\ILMerge.exe /target:library /out:' + $temporaryFolder + '/' + $tweetinviAPIMerged + ' '

for ($i=0; $i -lt $additionalAssemblies.length; $i++)
{
$ILMergeCommand = $ILMergeCommand + $temporaryFolder + '/' + $additionalAssemblies[$i] + ' '
}

for ($i=4; $i -lt $projects.length; $i++) # start at 4 as there are 4 projects that are not part of the library core
{
$ILMergeCommand = $ILMergeCommand + $temporaryFolder + '/' + $projects[$i] + '.dll '
}

Write-Host $ILMergeCommand
Invoke-Expression $ILMergeCommand

# Create Zip files
$tweetinviBinariesPackage = 'Tweetinvi ' + $version + ' - Binaries.zip'
$tweetinviMergedBinariesPackage = 'Tweetinvi ' + $version + ' - Merged Binaries.zip'

Write-Zip -OutputPath $tweetinviBinariesPackage (dir $temporaryFolder)
Write-Zip -OutputPath $tweetinviMergedBinariesPackage (ls $temporaryFolder\$tweetinviAPIMerged, $temporaryFolder\Cheatsheet.cs)

#Cleanup
rm DTAR_*
rm -r .\obj
$answer = Read-Host "Do you want to cleanup the temporary files? (y/n)"

while("y", "yes", "n", "no" -notcontains $answer)
{
$answer = Read-Host "Yes or No"
}

if ($answer -eq "y" -or $answer -eq "yes")
{
Remove-Item $temporaryFolder -Force -Recurse
Write-Host Temporary files successfully removed!
}
}

Write-Host Sript successfully terminated!
Write-Host Script successfully terminated!
24 changes: 24 additions & 0 deletions Developer Tools/TweetinviAPI/TweetinviAPI.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>TweetinviAPI</id>
<version>0.9.10.0</version>
<title>Tweetinvi</title>
<authors>Linvi</authors>
<owners>Linvi</owners>
<licenseUrl>http://tweetinvi.codeplex.com/license</licenseUrl>
<projectUrl>http://tweetinvi.codeplex.com/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Tweetinvi is an intuitive .NET C# library to access the Twitter REST API. It is a Portable Class Library that can be used for development on Windows, Windows RT, Windows Phone, Mono, Xamarin Android and Xamarin iOS. Tweetinvi is also compatible for Universal App development.</description>
<copyright>Tweetinvi 2015</copyright>
<language>en-US</language>
<tags>twitter c# rest rest api 1.1 .net</tags>
<dependencies>
<dependency id="Autofac" version="3.5.2" />
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
<dependency id="Microsoft.Bcl.Build" version="1.0.21" />
<dependency id="Microsoft.Net.Http" version="2.2.29" />
<dependency id="Newtonsoft.Json" version="7.0.1" />
</dependencies>
</metadata>
</package>
11 changes: 11 additions & 0 deletions Developer Tools/TweetinviAPI/tools/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Write-Host ''
Write-Host 'Welcome on Tweetinvi, please read the documentation at : https://github.com/linvi/tweetinvi/wiki'
Write-Host 'You can also get lots of examples from the Cheatsheet provided with this package : Cheatsheet.cs'
Write-Host ''
Write-Host 'EXAMPLE : Get the currently logged in user:'
Write-Host ''
Write-Host 'Auth.SetUserCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");'
Write-Host 'var user = User.GetLoggedUser();'
Write-Host 'Debug.WriteLine(user.ScreenName);'
Write-Host ''
Write-Host 'Please enjoy Tweetinvi!'
Binary file modified Developer Tools/Visual.Studio.Builder.ps1
Binary file not shown.
Binary file added Developer Tools/nuget.exe
Binary file not shown.
8 changes: 8 additions & 0 deletions Examplinvi.UniversalApp/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application
x:Class="Examplinvi.UniversalApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Examplinvi.UniversalApp"
RequestedTheme="Light">

</Application>
108 changes: 108 additions & 0 deletions Examplinvi.UniversalApp/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace Examplinvi.UniversalApp
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
Microsoft.ApplicationInsights.WindowsCollectors.Session);
this.InitializeComponent();
this.Suspending += OnSuspending;
}

/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{

#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif

Frame rootFrame = Window.Current.Content as Frame;

// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();

rootFrame.NavigationFailed += OnNavigationFailed;

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}

// Place the frame in the current Window
Window.Current.Content = rootFrame;
}

if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}

/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}

/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}
3 changes: 3 additions & 0 deletions Examplinvi.UniversalApp/ApplicationInsights.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns = "http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
</ApplicationInsights>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examplinvi.UniversalApp/Assets/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3ceb0a2

Please sign in to comment.