diff --git a/Directory.Build.props b/Directory.Build.props index 3038194c7..604e4b506 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,9 @@ Debug <_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\ + true - + cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant true @@ -19,6 +20,10 @@ Project="$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))).override.props" Condition=" Exists('$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))).override.props') " /> + $(DotnetToolPath) "$(_JNIEnvGenPath)" <_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)" - + diff --git a/GitInfo.txt b/GitInfo.txt new file mode 100644 index 000000000..ceab6e11e --- /dev/null +++ b/GitInfo.txt @@ -0,0 +1 @@ +0.1 \ No newline at end of file diff --git a/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj b/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj index 77f5a8667..85b828a55 100644 --- a/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj +++ b/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.csproj @@ -18,4 +18,6 @@ + + diff --git a/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/GenerateVersionFile.cs b/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/GenerateVersionFile.cs new file mode 100644 index 000000000..c6e8503f2 --- /dev/null +++ b/build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/GenerateVersionFile.cs @@ -0,0 +1,27 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; +using System.IO; +using System.Collections.Generic; + + +namespace Java.Interop.BootstrapTasks +{ + public class GenerateVersionFile : Task + { + public ITaskItem InputFile { get; set; } + public ITaskItem OutputFile { get; set; } + + public ITaskItem [] Replacements { get; set; } + public override bool Execute () + { + string text = File.ReadAllText (InputFile.ItemSpec); + foreach (var replacement in Replacements) + { + text = text.Replace (replacement.ItemSpec, replacement.GetMetadata ("Replacement")); + } + File.WriteAllText (OutputFile.ItemSpec, text); + return !Log.HasLoggedErrors; + } + } +} diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 6888adaf8..ce6da00d6 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -58,7 +58,7 @@ jobs: solution: Java.Interop.sln configuration: $(Build.Configuration) msbuildArguments: /restore - + - task: MSBuild@1 displayName: MSBuild RunNUnitTests.targets inputs: @@ -93,7 +93,22 @@ jobs: runNativeDotnetTests: true - template: templates\fail-on-issue.yaml - + + - task: ArchiveFiles@2 + displayName: 'Archive build outputs' + inputs: + rootFolderOrFile: 'bin' + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/bin-dotnet.zip' + replaceExistingArchive: true + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: debug' + inputs: + ArtifactName: debug + condition: succeededOrFailed() + - job: mac_build displayName: Mac - Mono pool: @@ -114,10 +129,10 @@ jobs: - script: make prepare CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) displayName: make prepare - + - script: make all CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) displayName: make all - + - script: | r=0 make run-all-tests CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) || r=$? @@ -139,7 +154,7 @@ jobs: SourceFolder: $(System.DefaultWorkingDirectory) Contents: | xatb.jar - bin.zip + bin.zip TargetFolder: $(Build.ArtifactStagingDirectory) condition: succeededOrFailed() @@ -148,7 +163,7 @@ jobs: inputs: ArtifactName: debug condition: succeededOrFailed() - + - job: mac_dotnet_build displayName: Mac - .NET Core pool: @@ -161,12 +176,12 @@ jobs: submodules: recursive - template: templates\install-dependencies.yaml - + - script: make prepare-core CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) displayName: make prepare-core - + - template: templates\core-build.yaml - + - template: templates\core-tests.yaml parameters: runNativeTests: true diff --git a/build-tools/scripts/AssemblyInfo.g.cs.in b/build-tools/scripts/AssemblyInfo.g.cs.in new file mode 100644 index 000000000..15d49cc72 --- /dev/null +++ b/build-tools/scripts/AssemblyInfo.g.cs.in @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft Corporation")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("@CONFIGURATION@")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Microsoft Corporation")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("@VERSION@.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("@INFORMATIONALVERSION@")] +[assembly: System.Reflection.AssemblyProductAttribute("@PRODUCT@")] +[assembly: System.Reflection.AssemblyTitleAttribute("@TITLE@")] +[assembly: System.Reflection.AssemblyVersionAttribute("@VERSION@.0")] + +// Generated by the MSBuild WriteCodeFragment class. \ No newline at end of file diff --git a/build-tools/scripts/Prepare.targets b/build-tools/scripts/Prepare.targets index b13e9651a..5dc688d4c 100644 --- a/build-tools/scripts/Prepare.targets +++ b/build-tools/scripts/Prepare.targets @@ -6,7 +6,10 @@ - + <_MaxJdk>$(MaxJdkVersion) <_MaxJdk Condition=" '$(_MaxJdk)' == '' ">$(JI_MAX_JDK) diff --git a/build-tools/scripts/Version.props.in b/build-tools/scripts/Version.props.in new file mode 100644 index 000000000..cbefc19da --- /dev/null +++ b/build-tools/scripts/Version.props.in @@ -0,0 +1,8 @@ + + + @VERSION@ + @VERSION@ git-rev-head:@COMMIT@ git-branch:@BRANCH@ + Microsoft Corporation + Microsoft Corporation + + \ No newline at end of file diff --git a/build-tools/scripts/VersionInfo.targets b/build-tools/scripts/VersionInfo.targets new file mode 100644 index 000000000..cf676a95c --- /dev/null +++ b/build-tools/scripts/VersionInfo.targets @@ -0,0 +1,29 @@ + + + + + + main + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj b/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj index 0204f38b3..228da5b2a 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj @@ -7,9 +7,6 @@ true ..\..\product.snk Java.Interop.Dynamic - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop.Export/Java.Interop.Export.csproj b/src/Java.Interop.Export/Java.Interop.Export.csproj index 8d923e92d..b1dd39bd6 100644 --- a/src/Java.Interop.Export/Java.Interop.Export.csproj +++ b/src/Java.Interop.Export/Java.Interop.Export.csproj @@ -7,9 +7,6 @@ true ..\..\product.snk Java.Interop.Export - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj b/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj index 62da24d00..1b69c773e 100644 --- a/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj +++ b/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj @@ -7,9 +7,6 @@ true ..\..\product.snk Java.Interop.GenericMarshaler - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj index ea4be696a..9dce7a0ac 100644 --- a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj +++ b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj @@ -7,9 +7,6 @@ INTERNAL_NULLABLE_ATTRIBUTES {5C0B3562-8DA0-4726-9762-75B9709ED6B7} Java.Interop.Tools.JavaSource - Microsoft Corporation - Microsoft Corporation - 0.1.0.0 $(ToolOutputFullPath) diff --git a/src/Java.Interop/Directory.Build.targets b/src/Java.Interop/Directory.Build.targets index c91706ab8..c5bd6af31 100644 --- a/src/Java.Interop/Directory.Build.targets +++ b/src/Java.Interop/Directory.Build.targets @@ -31,4 +31,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Java.Interop/Java.Interop-MonoAndroid.csproj b/src/Java.Interop/Java.Interop-MonoAndroid.csproj index 9061a960f..b667313b1 100644 --- a/src/Java.Interop/Java.Interop-MonoAndroid.csproj +++ b/src/Java.Interop/Java.Interop-MonoAndroid.csproj @@ -16,6 +16,7 @@ ..\..\product.snk 8.0 true + true @@ -85,6 +86,7 @@ + BuildVersionInfo_g_cs; BuildJniEnvironment_g_cs; BuildInteropJar; $(BuildDependsOn) diff --git a/src/Java.Interop/Java.Interop.csproj b/src/Java.Interop/Java.Interop.csproj index 263a61de3..e61282d0e 100644 --- a/src/Java.Interop/Java.Interop.csproj +++ b/src/Java.Interop/Java.Interop.csproj @@ -22,7 +22,6 @@ ..\..\product.snk INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS;INTERNAL_NULLABLE_ATTRIBUTES;$(JavaInteropDefineConstants) true - false $(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\ $(ToolOutputFullPath) $(ToolOutputFullPath)Java.Interop.xml diff --git a/src/Java.Interop/Properties/AssemblyInfo.cs b/src/Java.Interop/Properties/AssemblyInfo.cs index 5222403e5..b32e4cf93 100644 --- a/src/Java.Interop/Properties/AssemblyInfo.cs +++ b/src/Java.Interop/Properties/AssemblyInfo.cs @@ -3,16 +3,9 @@ using System.Runtime.InteropServices; [assembly: DefaultDllImportSearchPathsAttribute (DllImportSearchPath.SafeDirectories | DllImportSearchPath.AssemblyDirectory)] - -[assembly: AssemblyTitle ("Java.Interop")] [assembly: AssemblyDescription ("")] [assembly: AssemblyCulture ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("Microsoft Corporation")] -[assembly: AssemblyCopyright ("Microsoft Corporation")] -[assembly: AssemblyProduct ("")] [assembly: AssemblyTrademark ("Microsoft Corporation")] -[assembly: AssemblyVersion ("0.1.0.0")] [assembly: AssemblyMetadata ("IsTrimmable", "True")] [assembly: InternalsVisibleTo (