mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Preparing to make the credentials flow into the project at build time.
This commit is contained in:
parent
cfdc7a7ec2
commit
58050f5092
8 changed files with 241 additions and 187 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -209,3 +209,6 @@ FakesAssemblies/
|
|||
GeneratedArtifacts/
|
||||
_Pvt_Extensions/
|
||||
ModelManifest.xml
|
||||
|
||||
# Greenshot credentials files
|
||||
*.credentials.cs
|
|
@ -63,8 +63,59 @@
|
|||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Tokens Include="Box_ClientId">
|
||||
<ReplacementValue>$(Box_ClientId)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Box_ClientSecret">
|
||||
<ReplacementValue>$(Box_ClientSecret)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="DropBox_ClientId">
|
||||
<ReplacementValue>$(DropBox_ClientId)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="DropBox_ClientSecret">
|
||||
<ReplacementValue>$(DropBox_ClientSecret)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Flickr_ClientId">
|
||||
<ReplacementValue>$(Flickr_ClientId)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Flickr_ClientSecret">
|
||||
<ReplacementValue>$(Flickr_ClientSecret)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Imgur_ClientId">
|
||||
<ReplacementValue>$(Imgur_ClientId)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Imgur_ClientSecret">
|
||||
<ReplacementValue>$(Imgur_ClientSecret)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Photobucket_ClientId">
|
||||
<ReplacementValue>$(Photobucket_ClientId)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Photobucket_ClientSecret">
|
||||
<ReplacementValue>$(Photobucket_ClientSecret)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Picasa_ClientId">
|
||||
<ReplacementValue>$(Picasa_ClientId)</ReplacementValue>
|
||||
</Tokens>
|
||||
<Tokens Include="Picasa_ClientSecret">
|
||||
<ReplacementValue>$(Picasa_ClientSecret)</ReplacementValue>
|
||||
</Tokens>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="Exists('$(ProjectName).Credentials.template')">
|
||||
<PackageReference Include="MSBuildTasks" Version="1.5.0.235" GeneratePathProperty="true"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(PkgTools_MSBuildTasks)MSBuild.Community.Tasks.Targets" Condition="Exists('$(ProjectName).Credentials.template')"/>
|
||||
|
||||
<Target Name="Process templates" BeforeTargets="PrepareForBuild" Condition="Exists('$(ProjectName).Credentials.template')">
|
||||
<Message Text="Processing: $(ProjectName).Credentials.template" />
|
||||
<TemplateFile Template="$(ProjectName).Credentials.template" OutputFilename="$(ProjectName).Credentials.cs" Tokens="@(Tokens)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" BeforeTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true' And $(MSBuildProjectName.Contains('Plugin')) And !$(MSBuildProjectName.Contains('Test')) And !$(MSBuildProjectName.Contains('Demo'))">
|
||||
<Exec Command="
|
||||
|
||||
xcopy /y /d "$(TargetDir)$(TargetName).*" "$(SolutionDir)$(SolutionName)\$(OutDir)"

|
||||
xcopy /y /d "$(TargetDir)*.dll" "$(SolutionDir)$(SolutionName)\$(OutDir)"

|
||||
xcopy /y /d "$(TargetDir)*.xml" "$(SolutionDir)$(SolutionName)\$(OutDir)"


|
||||
|
|
|
@ -25,7 +25,7 @@ namespace GreenshotBoxPlugin {
|
|||
/// You can set your own values here
|
||||
/// </summary>
|
||||
public static class BoxCredentials {
|
||||
public static string ClientId = "@credentials_box_client_id@";
|
||||
public static string ClientSecret = "@credentials_box_client_secret@";
|
||||
public static string ClientId = "${Box_ClientId}";
|
||||
public static string ClientSecret = "${Box_ClientSecret}";
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ namespace GreenshotDropboxPlugin {
|
|||
/// You can set your own values here
|
||||
/// </summary>
|
||||
public static class DropBoxCredentials {
|
||||
public static string CONSUMER_KEY = "@credentials_dropbox_consumer_key@";
|
||||
public static string CONSUMER_SECRET = "@credentials_dropbox_consumer_secret@";
|
||||
public static string CONSUMER_KEY = "${DropBox_ClientId}";
|
||||
public static string CONSUMER_SECRET = "${DropBox_ClientSecret}";
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ namespace GreenshotFlickrPlugin {
|
|||
/// You can set your own values here
|
||||
/// </summary>
|
||||
public static class FlickrCredentials {
|
||||
public static string ConsumerKey = "@credentials_flickr_consumer_key@";
|
||||
public static string ConsumerSecret = "@credentials_flickr_consumer_secret@";
|
||||
public static string ConsumerKey = "${Flickr_ClientId}";
|
||||
public static string ConsumerSecret = "${Flickr_ClientSecret}";
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ namespace GreenshotImgurPlugin {
|
|||
/// You can set your own values here
|
||||
/// </summary>
|
||||
public static class ImgurCredentials {
|
||||
public static string CONSUMER_KEY = "@credentials_imgur_consumer_key@";
|
||||
public static string CONSUMER_SECRET = "@credentials_imgur_consumer_secret@";
|
||||
public static string CONSUMER_KEY = "${Imgur_ClientId}";
|
||||
public static string CONSUMER_SECRET = "${Imgur_ClientSecret}";
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ namespace GreenshotPhotobucketPlugin {
|
|||
/// You can set your own values here
|
||||
/// </summary>
|
||||
public static class PhotobucketCredentials {
|
||||
public static string ConsumerKey = "@credentials_photobucket_consumer_key@";
|
||||
public static string ConsumerSecret = "@credentials_photobucket_consumer_secret@";
|
||||
public static string ConsumerKey = "${Photobucket_ClientId}";
|
||||
public static string ConsumerSecret = "${Photobucket_ClientSecret}";
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ namespace GreenshotPicasaPlugin {
|
|||
/// You can set your own values here
|
||||
/// </summary>
|
||||
public static class PicasaCredentials {
|
||||
public static string ClientId = "@credentials_picasa_consumer_key@";
|
||||
public static string ClientSecret = "@credentials_picasa_consumer_secret@";
|
||||
public static string ClientId = "${Picasa_ClientId}";
|
||||
public static string ClientSecret = "${Picasa_ClientSecret}";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue