Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move OkHttp projects to simplify build #1242

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions Android/SquareOkHttp/build.cake
@@ -1,19 +1,25 @@
var TARGET = Argument ("t", Argument ("target", "ci"));

var NUGET_VERSION = "2.7.5.1";
var NUGET_VERSION = "2.7.5.2";

var JAR_VERSION = "2.7.5";
var JAR_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/{JAR_VERSION}/okhttp-{JAR_VERSION}.jar";
var JAR_OKHTTP_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/{JAR_VERSION}/okhttp-{JAR_VERSION}.jar";
var JAR_OKHTTP_URLCONNECTION_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp-urlconnection/{JAR_VERSION}/okhttp-urlconnection-{JAR_VERSION}.jar";
var JAR_OKHTTP_WS_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp-ws/{JAR_VERSION}/okhttp-ws-{JAR_VERSION}.jar";

Task ("externals")
.Does (() =>
{
EnsureDirectoryExists ("./externals");

DownloadFile(JAR_URL, "./externals/okhttp.jar");
DownloadFile(JAR_OKHTTP_URL, "./externals/okhttp.jar");
DownloadFile(JAR_OKHTTP_URLCONNECTION_URL, "./externals/okhttp-urlconnection.jar");
DownloadFile(JAR_OKHTTP_WS_URL, "./externals/okhttp-ws.jar");

// Update .csproj nuget versions
XmlPoke("./source/Square.OkHttp/Square.OkHttp.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
XmlPoke("./source/Square.OkHttp.UrlConnection/Square.OkHttp.UrlConnection.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
XmlPoke("./source/Square.OkHttp.WS/Square.OkHttp.WS.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
});

Task("nuget")
Expand Down
22 changes: 22 additions & 0 deletions Android/SquareOkHttp/cgmanifest.json
Expand Up @@ -10,6 +10,28 @@
"NuGetId": "Square.OkHttp3"
}
}
},
{
"Component": {
"Type": "Maven",
"Maven": {
"ArtifactId": "okhttp-urlconnection",
"GroupId": "com.squareup.okhttp",
"Version": "2.7.5",
"NuGetId": "Square.OkHttp.UrlConnection"
}
}
},
{
"Component": {
"Type": "Maven",
"Maven": {
"ArtifactId": "okhttp-ws",
"GroupId": "com.squareup.okhttp",
"Version": "2.7.5",
"NuGetId": "Square.OkHttp.WS"
}
}
}
],
"Version": 1
Expand Down
6 changes: 6 additions & 0 deletions Android/SquareOkHttp/samples/OkHttpSample.sln
Expand Up @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OkHttpSample", "OkHttpSampl
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.OkHttp", "..\source\Square.OkHttp\Square.OkHttp.csproj", "{47225658-05B3-4F0D-A040-6A22E238F4B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.OkHttp.WS", "..\source\Square.OkHttp.WS\Square.OkHttp.WS.csproj", "{04A89A26-C768-4AB2-87F1-8392DF4258F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,6 +23,10 @@ Global
{47225658-05B3-4F0D-A040-6A22E238F4B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47225658-05B3-4F0D-A040-6A22E238F4B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47225658-05B3-4F0D-A040-6A22E238F4B0}.Release|Any CPU.Build.0 = Release|Any CPU
{04A89A26-C768-4AB2-87F1-8392DF4258F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04A89A26-C768-4AB2-87F1-8392DF4258F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04A89A26-C768-4AB2-87F1-8392DF4258F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04A89A26-C768-4AB2-87F1-8392DF4258F5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Expand Up @@ -13,7 +13,7 @@
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
</PropertyGroup>
Expand All @@ -27,6 +27,7 @@
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidDexTool>dx</AndroidDexTool>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
Expand Down
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourcompany.okhttpsample" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
<application android:label="@string/ApplicationName" android:icon="@drawable/Icon"></application>
</manifest>
Expand Up @@ -13,7 +13,7 @@
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
</PropertyGroup>
Expand All @@ -26,6 +26,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
Expand All @@ -50,9 +51,6 @@
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
<PackageReference Include="Square.OkIO" Version="1.6.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Square.OkHttp">
<Version>2.7.5.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand All @@ -69,9 +67,13 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Square.OkHttp.WS\Square.OkHttp.WS.csproj">
<Project>{15F960CA-7894-42F1-A7D1-53E46935D39B}</Project>
<Project>{04A89A26-C768-4AB2-87F1-8392DF4258F5}</Project>
<Name>Square.OkHttp.WS</Name>
</ProjectReference>
<ProjectReference Include="..\..\source\Square.OkHttp\Square.OkHttp.csproj">
<Project>{47225658-05B3-4F0D-A040-6A22E238F4B0}</Project>
<Name>Square.OkHttp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourcompany.okhttpwssample" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
<application android:label="@string/ApplicationName" android:icon="@drawable/Icon"></application>
</manifest>
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/2.1.2">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<PropertyGroup>
<TargetFrameworks>monoandroid9.0</TargetFrameworks>
<TargetFrameworks>monoandroid10.0</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<AssemblyName>Square.OkHttp.UrlConnection</AssemblyName>
<RootNamespace>Square.OkHttp.UrlConnection</RootNamespace>
Expand All @@ -23,22 +23,21 @@
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>okhttp square square.okhttp xamarin android monodroid</PackageTags>
<PackageVersion>2.7.5.1</PackageVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Square.OkHttp" Version="2.7.5.1" />
</ItemGroup>
<PackageVersion>2.7.5.2</PackageVersion>
</PropertyGroup>

<ItemGroup>
<None Remove="Transforms\*.xml" />
<TransformFile Include="Transforms\*.xml" />
<EmbeddedJar Include="..\..\externals\*.jar" Link="Jars\%(Filename)%(Extension)" />
<LibraryProjectZip Include="..\..\externals\*.aar" Link="Jars\%(Filename)%(Extension)" />
<EmbeddedJar Include="..\..\externals\okhttp-urlconnection.jar" Link="Jars\%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\icons\square.okhttp_256x256.png" Pack="True" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Square.OkHttp\Square.OkHttp.csproj" />
</ItemGroup>
</Project>
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<PropertyGroup>
<TargetFrameworks>monoandroid9.0</TargetFrameworks>
<TargetFrameworks>monoandroid10.0</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<AssemblyName>Square.OkHttp.WS</AssemblyName>
<RootNamespace>Square.OkHttp.WS</RootNamespace>
Expand All @@ -19,26 +19,25 @@
<Owners>Microsoft</Owners>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=2130312</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/xamarin/XamarinComponents/master/Android/SquareOkHttpWS/icons/square.okhttp.ws_256x256.png</PackageIconUrl>
<PackageIcon>square.okhttp_256x256.png</PackageIcon>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>websocket okhttp square square.okhttp xamarin android monodroid</PackageTags>
<PackageVersion>2.7.5.1</PackageVersion>
<PackageVersion>2.7.5.2</PackageVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Square.OkHttp" Version="2.7.5.1" />
</ItemGroup>


<ItemGroup>
<None Remove="Transforms\*.xml" />
<TransformFile Include="Transforms\*.xml" />
<EmbeddedJar Include="..\..\externals\*.jar" Link="Jars\%(Filename)%(Extension)" />
<LibraryProjectZip Include="..\..\externals\*.aar" Link="Jars\%(Filename)%(Extension)" />
<EmbeddedJar Include="..\..\externals\okhttp-ws.jar" Link="Jars\okhttp-ws.jar" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\icons\square.okhttp_256x256.png" Pack="True" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Square.OkHttp\Square.OkHttp.csproj" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions Android/SquareOkHttp/source/Square.OkHttp.sln
Expand Up @@ -3,6 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.OkHttp", "Square.OkHttp\Square.OkHttp.csproj", "{57FB9D46-F6EB-49B7-AF8C-06E063961F3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.OkHttp.WS", "Square.OkHttp.WS\Square.OkHttp.WS.csproj", "{8BB7484D-43F5-4C1C-953F-6FF83AFA177D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.OkHttp.UrlConnection", "Square.OkHttp.UrlConnection\Square.OkHttp.UrlConnection.csproj", "{5EA8F782-B5F1-481D-9BCC-0209F0969F81}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -13,5 +17,13 @@ Global
{57FB9D46-F6EB-49B7-AF8C-06E063961F3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57FB9D46-F6EB-49B7-AF8C-06E063961F3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57FB9D46-F6EB-49B7-AF8C-06E063961F3A}.Release|Any CPU.Build.0 = Release|Any CPU
{8BB7484D-43F5-4C1C-953F-6FF83AFA177D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BB7484D-43F5-4C1C-953F-6FF83AFA177D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BB7484D-43F5-4C1C-953F-6FF83AFA177D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BB7484D-43F5-4C1C-953F-6FF83AFA177D}.Release|Any CPU.Build.0 = Release|Any CPU
{5EA8F782-B5F1-481D-9BCC-0209F0969F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EA8F782-B5F1-481D-9BCC-0209F0969F81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EA8F782-B5F1-481D-9BCC-0209F0969F81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EA8F782-B5F1-481D-9BCC-0209F0969F81}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
12 changes: 6 additions & 6 deletions Android/SquareOkHttp/source/Square.OkHttp/Square.OkHttp.csproj
@@ -1,6 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<PropertyGroup>
<TargetFrameworks>monoandroid9.0</TargetFrameworks>
<TargetFrameworks>monoandroid10.0</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<AssemblyName>Square.OkHttp</AssemblyName>
<RootNamespace>Square.OkHttp</RootNamespace>
Expand All @@ -19,11 +19,11 @@
<Owners>Microsoft</Owners>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=2130312</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/xamarin/XamarinComponents/master/Android/SquareOkHttp/icons/square.okhttp_256x256.png</PackageIconUrl>
<PackageIcon>square.okhttp_256x256.png</PackageIcon>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>okhttp square square.okhttp xamarin android monodroid</PackageTags>
<PackageVersion>2.7.5.1</PackageVersion>
<PackageVersion>2.7.5.2</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -33,11 +33,11 @@
<ItemGroup>
<None Remove="Transforms\*.xml" />
<TransformFile Include="Transforms\*.xml" />
<EmbeddedJar Include="..\..\externals\*.jar" Link="Jars\%(Filename)%(Extension)" />
<LibraryProjectZip Include="..\..\externals\*.aar" Link="Jars\%(Filename)%(Extension)" />
<EmbeddedJar Include="..\..\externals\okhttp.jar" Link="Jars\okhttp.jar" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\License.md" Pack="true" PackagePath="LICENSE.md" />
<None Include="..\..\icons\square.okhttp_256x256.png" Pack="True" PackagePath="\" />
</ItemGroup>
</Project>
16 changes: 12 additions & 4 deletions Android/SquareOkHttp3-v3/build.cake
@@ -1,22 +1,28 @@
var TARGET = Argument ("t", Argument ("target", "ci"));

// this is used for the NuGet diff as v4 is a major changes
var NUGET_OLD_VERSION = "3.14.4";
var NUGET_OLD_VERSION = "3.14.9";

var NUGET_VERSION = "3.14.9";
var NUGET_VERSION = "3.14.9.1";

var JAR_VERSION = "3.14.9";
var JAR_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/{JAR_VERSION}/okhttp-{JAR_VERSION}.jar";
var JAR_OKHTTP_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/{JAR_VERSION}/okhttp-{JAR_VERSION}.jar";
var JAR_OKHTTP_URLCONNECTION_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/{JAR_VERSION}/okhttp-urlconnection-{JAR_VERSION}.jar";
var JAR_OKHTTP_LOGGING_URL = $"https://repo1.maven.org/maven2/com/squareup/okhttp3/logging-interceptor/{JAR_VERSION}/logging-interceptor-{JAR_VERSION}.jar";

Task ("externals")
.Does (() =>
{
EnsureDirectoryExists ("./externals");

DownloadFile(JAR_URL, "./externals/okhttp3.jar");
DownloadFile(JAR_OKHTTP_URL, "./externals/okhttp3.jar");
DownloadFile(JAR_OKHTTP_URLCONNECTION_URL, "./externals/okhttp3-urlconnection.jar");
DownloadFile(JAR_OKHTTP_LOGGING_URL, "./externals/okhttp3-logging-interceptor.jar");

// Update .csproj nuget versions
XmlPoke("./source/Square.OkHttp3/Square.OkHttp3.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
XmlPoke("./source/Square.OkHttp3.UrlConnection/Square.OkHttp3.UrlConnection.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
XmlPoke("./source/Square.OkHttp3.LoggingInterceptor/Square.OkHttp3.LoggingInterceptor.csproj", "/Project/PropertyGroup/PackageVersion", NUGET_VERSION);
});

Task("nuget")
Expand All @@ -35,6 +41,8 @@ Task("nuget")
});

System.IO.File.WriteAllText($"./output/Square.OkHttp3.{NUGET_VERSION}.nupkg.baseversion", NUGET_OLD_VERSION);
System.IO.File.WriteAllText($"./output/Square.OkHttp3.UrlConnection.{NUGET_VERSION}.nupkg.baseversion", NUGET_OLD_VERSION);
System.IO.File.WriteAllText($"./output/Square.OkHttp3.LoggingInterceptor.{NUGET_VERSION}.nupkg.baseversion", NUGET_OLD_VERSION);
});

Task("samples")
Expand Down
33 changes: 33 additions & 0 deletions Android/SquareOkHttp3-v3/cgmanifest.json
Expand Up @@ -10,6 +10,39 @@
"NuGetId": "Square.OkHttp3"
}
}
},
{
"Component": {
"Type": "Maven",
"Maven": {
"ArtifactId": "okhttp-urlconnection",
"GroupId": "com.squareup.okhttp3",
"Version": "3.14.9",
"NuGetId": "Square.OkHttp3.UrlConnection"
}
}
},
{
"Component": {
"Type": "Maven",
"Maven": {
"ArtifactId": "logging-interceptor",
"GroupId": "com.squareup.okhttp3",
"Version": "3.14.9",
"NuGetId": "Square.OkHttp3.LoggingInterceptor"
}
}
},
{
"Component": {
"Type": "Maven",
"Maven": {
"ArtifactId": "okhttp-ws",
"GroupId": "com.squareup.okhttp3",
"Version": "3.4.2",
"NuGetId": "Square.OkHttp3.WS"
}
}
}
],
"Version": 1
Expand Down
Expand Up @@ -13,7 +13,7 @@
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
</PropertyGroup>
Expand Down