diff --git a/.gitignore b/.gitignore index e703347..38c25a4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ build SolutionInfo.cs .paket/paket.exe paket-files +*.snk \ No newline at end of file diff --git a/TextExtraction.snk b/TextExtraction.snk deleted file mode 100644 index 578f3d2..0000000 Binary files a/TextExtraction.snk and /dev/null differ diff --git a/appveyor.yml b/appveyor.yml index 15157e7..0cce36c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,7 @@ version: 1.0.{build} environment: + snk: + secure: K+FJ6oBTI+HLJhAiHeQN+Ryofta7b8xBrFYq8UJSXyhLyLGPCqcEseUUbs5emkSXV+EfiPGtTngYlafMXynFulhra5MDfWm8r37Go7WOPaDmxH7nvxnarBs/mIFuxOWzxiAlyfDbmzYagGlEoqeWpcMdGGIz1rrqPm9EIS0RNQ5rymfXIQzit7tEaRprHSEN9Jl0gua48BXKFi+s7gRmsNbbCrLshxybXfjcMz+jcaw7U+rtcHD4RjNf9NVqIXPnSseAZxLWZgvYqksJ44T7Nsn6GNSEap1TGReGls8xkwAxPVpPvrq6NSTiJsGU501YU8Vhy2LXFyVUg0H0QMol2YDRfvIiVIhO/mGbtkech/qM1zUpK47n/n2H4Ivy+KGZ+S301qhacKLY5Ts1Mn4OUaPBOWsgAn/s2dSz/lTlYU0lEdiaJg6G06j4jghnvip3PsW/CPG77yMidSN07itMB2m8V7e8idNpoQajDDtz7Xch/1CUMzfiFiS1E6TA/xJXbFOvq3fLthYe2mXpZG5Zuk72bop2eBpvOQaSu9qsSBASVO8j4Ekrr1P59B6IWE/1kcD4XI7sT+hUBD9kpJgoGoUyVS/xWuiDdTuaO1FfBIVI6VEYv+6W1f8Sa6E+lnuzq691l7gmlguf0os+uIqQ7YAtXyrB3jYJJMZOHgsDHMGh4g89MmTsS/qxgaYQoGGAx3GeDX0g+GUDsJMGwXb1xcCphHlOY5uzyk8Yw5t+sVoKgSOEumRc2bIBkRx8dKmZx/50pl75Mdvtpdf4Kb374ryefGaeAGFBTfbuy0CWxML6G8Kj4JM7HmzmBuYMA6UJ3Spnnjrems9lIMgZShqTFH6kiL4XYMUwTUoNyT7acPER0owryawF+Df2h1uxkD7gzGQZMAdLRJ4mQQx+ALd8sk7dMrYS+W08j3R3zXU4pj9jdYt1CJiaO6m0x2dUOiwXXkyGp6dvR0oHCBGDT08DrbsSfZ+bd4viiFKNl1ciDHgU4PiXJ8a+z2GwTIsBqK+vfDyXNtcU6LdeM+PbdqGqAHcZMjV81xHJoFfgGFdrvc8Cmh/0N3SCCBTSo5TX3S+d nugetkey: secure: JNpnpSglMOIdpmkuqgvwvY6jzqEabYZH1hRziq/GddbsMNWyObRk07km0SZYBfT1 build_script: diff --git a/build.fsx b/build.fsx index be9583c..46be346 100644 --- a/build.fsx +++ b/build.fsx @@ -18,6 +18,8 @@ let tempDir = "temp" let tikaLibDir = "lib" let solutionFile = "src/TikaOnDotNet.sln" +let keyFile = (fileInfo "TikaOnDotNet.snk") + let []rootPath = __SOURCE_DIRECTORY__ let testAssemblies = "src/**/bin/Release/*Tests*.dll" type root = FileSystem @@ -54,10 +56,13 @@ let IKVMCompile workingDirectory tasks = let rec compile (task:IKVMcTask) = let getIKVMCommandLineArgs() = let sb = Text.StringBuilder() - bprintf sb "-keyfile:..\TextExtraction.snk -target:library -assembly:%s" - (task.AssemblyName) + + if keyFile.Exists + then bprintf sb "-keyfile:%s -target:library -assembly:%s" keyFile.FullName task.AssemblyName + if not <| String.IsNullOrEmpty(task.Version) then task.Version |> bprintf sb " -version:%s" + bprintf sb " %s -out:%s" (task.JarFile |> getNewFileName ".jar") (task.AssemblyName + ".dll") @@ -68,7 +73,7 @@ let IKVMCompile workingDirectory tasks = tasks |> Seq.iter compile Target "Clean" (fun _ -> - CleanDirs [artifactDir; tempDir; tikaLibDir] + CleanDirs [artifactDir; tempDir; tikaLibDir] ) Target "SetVersions" (fun _ -> @@ -80,8 +85,13 @@ Target "SetVersions" (fun _ -> ) Target "Build" (fun _ -> + let strongName = + if keyFile.Exists + then ["SignAssembly","true"; "AssemblyOriginatorKeyFile",keyFile.FullName] + else [] + !! solutionFile - |> MSBuildRelease "" "Clean;Rebuild" + |> MSBuildReleaseExt "" strongName "Clean;Rebuild" |> ignore ) @@ -116,8 +126,22 @@ Target "PublishNugets" (fun _ -> WorkingDir = artifactDir }) ) +Target "BuildSNK" (fun _ -> + let snkBase64 = environVarOrNone "snk" + match snkBase64 with + | Some env -> + ( + trace "Replacing .snk" + keyFile.Delete |> ignore + let snkbytes = System.Convert.FromBase64String(env) + System.IO.File.WriteAllBytes(keyFile.FullName, snkbytes) + ) + | None -> trace "No key found in the \"snk\" environment" +) + "Clean" ==> "SetVersions" + ==> "BuildSNK" ==> "CompileTikaLib" ==> "Build" ==> "RunTests" diff --git a/src/TikaOnDotnet.TextExtractor/TextExtraction.snk b/src/TikaOnDotnet.TextExtractor/TextExtraction.snk deleted file mode 100644 index 578f3d2..0000000 Binary files a/src/TikaOnDotnet.TextExtractor/TextExtraction.snk and /dev/null differ diff --git a/src/TikaOnDotnet.TextExtractor/TikaOnDotnet.TextExtraction.csproj b/src/TikaOnDotnet.TextExtractor/TikaOnDotnet.TextExtraction.csproj index e948c3c..683aae7 100644 --- a/src/TikaOnDotnet.TextExtractor/TikaOnDotnet.TextExtraction.csproj +++ b/src/TikaOnDotnet.TextExtractor/TikaOnDotnet.TextExtraction.csproj @@ -34,16 +34,10 @@ - - true - - - TextExtraction.snk - - + False ..\..\lib\TikaOnDotNet.dll @@ -60,17 +54,16 @@ - -