Skip to content

Commit f23e19a

Browse files
committed
支持aspnet_packer在linux上运行打包
1 parent 686666e commit f23e19a

40 files changed

+67
-17
lines changed

aspnet_pack.sh

+20-4
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,34 @@ cp -r ../../JR.Cms.App/install ../../JR.Cms.App/oem \
2121
echo "setup2: building.." && \
2222
#xbuild *.csproj /p:Configuration=Release
2323

24+
2425
mkdir ${RELEASE_DIR}/root \
2526
&& cp -r root/*.md ${RELEASE_DIR}/root \
2627
&& mkdir ${RELEASE_DIR}/templates \
2728
&& cp -r templates/default ${RELEASE_DIR}/templates \
28-
&& cp -r bin public oem install plugins ${RELEASE_DIR} \
29+
&& cp -r public oem install plugins ${RELEASE_DIR} \
2930
&& cp Global.asax Web.config ${RELEASE_DIR}
3031

32+
# optimize Web.config file
33+
sed -i 's/compilation debug="true"/compilation debug="false"/g' Web.config \
34+
&& sed -i 's/\s*targetFramework="[^"]*"//g' Web.config
35+
36+
# if bin folder not exists. such on linux platform, use prebuild dll files to package.
37+
if [ -d bin ];then
38+
cp -r bin ${RELEASE_DIR}
39+
else
40+
mkdir ${RELEASE_DIR}/bin \
41+
&& cd ${RELEASE_DIR}/bin \
42+
&& unzip ../../../dll/aspnet_bin.zip >/dev/null
43+
# replace cms core dll
44+
find ../../../src/JR.Cms.App/bin/Debug -name "JR*.dll" | xargs -I {} cp {} .
45+
# remove net core entrypoint dll
46+
rm -rf JR.Cms.App.dll
47+
fi
48+
3149
cd ${RELEASE_DIR} \
32-
&& sed -i 's/compilation debug="true"/compilation debug="false"/g' Web.config \
33-
&& sed -i 's/\s*targetFramework="[^"]*"//g' Web.config \
3450
&& echo "setup3: clean assemblies.." \
35-
&& cd bin && rm -rf *.pdb *.xml *.config roslyn zh-Hans \
51+
&& cd bin && rm -rf *.pdb *.xml *.json *.config roslyn zh-Hans \
3652
Microsoft.Extensions.DependencyInjection.Abstractions.dll \
3753
Google.Protobuf.dll Microsoft.DotNet.PlatformAbstractions.dll \
3854
Microsoft.Extensions.WebEncoders.dll Microsoft.Extensions.Options.dll \

src/JR.Cms.App/config/cache.pid

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
481662
1+
127917

src/JR.Cms/Cms.cs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using JR.Stand.Core.Framework.Web.UI;
2424
using JR.Stand.Core.PluginKernel;
2525
using JR.Stand.Core.Template.Impl;
26+
using JR.Stand.Core.Utils;
2627
using JR.Stand.Core.Web;
2728
using JR.Stand.Core.Web.Cache;
2829
using Logger = JR.Stand.Core.Framework.Logger;

src/JR.Cms/Conf/LangReader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class LangLabelReader
1616
public LangLabelReader(string filePath)
1717
{
1818
this.filePath = filePath;
19-
this.cache = CacheFactory.Sington.RawCache();
19+
this.cache = CacheFactory.Singleton.RawCache();
2020
cacheKey = String.Format("lang_cache_{0}" ,this.filePath.GetHashCode());
2121
}
2222

src/JR.Cms/Conf/WebConfig.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Text;
44
using System.Text.RegularExpressions;
55
using JR.Stand.Core;
6+
using JR.Stand.Core.Utils;
67

78
namespace JR.Cms.Conf
89
{

src/JR.Cms/Core/CmsContext.cs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using JR.Stand.Core;
2525
using JR.Stand.Core.Framework.Web.Cache;
2626
using JR.Stand.Core.Template.Impl;
27+
using JR.Stand.Core.Utils;
2728
using JR.Stand.Core.Web;
2829

2930
namespace JR.Cms.Core

src/JR.Cms/Core/CmsUtility.cs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using System;
1515
using System.IO;
1616
using JR.Stand.Core;
17+
using JR.Stand.Core.Utils;
1718

1819
namespace JR.Cms.Core
1920
{

src/JR.Cms/Infrastructure/ResourceMap.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using JR.Stand.Core;
4+
using JR.Stand.Core.Utils;
45

56
namespace JR.Cms.Infrastructure
67
{

src/JR.Cms/Library/CacheProvider/Variables.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using JR.Stand.Core;
3+
using JR.Stand.Core.Utils;
34

45
namespace JR.Cms.Library.CacheProvider
56
{

src/JR.Cms/Library/DataAccess/DB/DBAccess.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using JR.Stand.Core;
44
using JR.Stand.Core.Data;
55
using JR.Stand.Core.Framework;
6+
using JR.Stand.Core.Utils;
67

78
namespace JR.Cms.Library.DataAccess.DB
89
{

src/JR.Cms/Library/DataAccess/DB/DBAccessCreator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Text.RegularExpressions;
44
using JR.Stand.Core;
55
using JR.Stand.Core.Data;
6+
using JR.Stand.Core.Utils;
67

78
namespace JR.Cms.Library.DataAccess.DB
89
{

src/JR.Cms/Updater.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using JR.Cms.Conf;
88
using JR.Cms.Infrastructure;
99
using JR.Stand.Core;
10+
using JR.Stand.Core.Utils;
1011
using SharpCompress.Archives;
1112
using SharpCompress.Common;
1213

src/JR.Cms/Web/Addon/HttpTag/HttpTags.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using JR.Stand.Core;
66
using Microsoft.AspNetCore.Http;
77
using JR.Stand.Core.Extensions.Http;
8+
using JR.Stand.Core.Utils;
89

910
namespace JR.Stand.Toolkit.HttpTag
1011
{

src/JR.Cms/Web/Manager/FileExplor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Text.RegularExpressions;
66
using JR.Stand.Abstracts.Web;
77
using JR.Stand.Core;
8+
using JR.Stand.Core.Utils;
89

910
namespace JR.Cms.Web.Manager
1011
{

src/JR.Cms/Web/Manager/Handle/AjaxHandler.cs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using JR.Cms.Web.Util;
3030
using JR.Stand.Core;
3131
using JR.Stand.Core.Framework.Text;
32+
using JR.Stand.Core.Utils;
3233
using JR.Stand.Core.Web;
3334
using static JR.Cms.Updater;
3435

src/JR.Cms/Web/Manager/Handle/ArchiveHandler.cs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
using JR.Stand.Abstracts.Web;
3232
using JR.Stand.Core;
3333
using JR.Stand.Core.Framework;
34+
using JR.Stand.Core.Utils;
3435
using JR.Stand.Core.Web;
3536
using JsonSerializer = JR.Cms.Web.Util.JsonSerializer;
3637

src/JR.Cms/Web/Manager/Handle/FileHandler.cs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System.Text;
1717
using JR.Cms.Conf;
1818
using JR.Stand.Core;
19+
using JR.Stand.Core.Utils;
1920

2021
namespace JR.Cms.Web.Manager.Handle
2122
{

src/JR.Cms/Web/Manager/Handle/ResourceHandler.cs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using JR.Cms.Web.Resource;
2323
using JR.Stand.Core;
2424
using JR.Stand.Core.Framework.Web.Cache;
25+
using JR.Stand.Core.Utils;
2526

2627

2728
// http://bbs.csdn.net/topics/300217787 #17

src/JR.Cms/Web/Manager/Handle/TemplateHandler.cs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using JR.Cms.Library.Utility;
2121
using JR.Stand.Core;
2222
using JR.Stand.Core.Framework;
23+
using JR.Stand.Core.Utils;
2324
using Newtonsoft.Json;
2425
using SharpCompress.Archives;
2526
using SharpCompress.Common;

src/JR.Cms/Web/Manager/Helper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using JR.Stand.Core;
2121
using JR.Stand.Core.Framework;
2222
using JR.Stand.Core.Framework.Web.UI;
23+
using JR.Stand.Core.Utils;
2324

2425
namespace JR.Cms.Web.Manager
2526
{

src/JR.Cms/Web/Resource/SiteResourceInit.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Text;
44
using JR.Cms.Conf;
55
using JR.Stand.Core;
6+
using JR.Stand.Core.Utils;
67

78
namespace JR.Cms.Web.Resource
89
{

src/JR.Stand.Core/Data/DataBaseAccess.cs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Text.RegularExpressions;
1818
using System.Threading;
1919
using JR.Stand.Core.Data.Extensions;
20+
using JR.Stand.Core.Utils;
2021

2122
namespace JR.Stand.Core.Data
2223
{

src/JR.Stand.Core/Framework/Graphic/GraphicsHelper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Drawing.Drawing2D;
55
using System.Drawing.Imaging;
66
using System.IO;
7+
using JR.Stand.Core.Utils;
78

89
/*******************************************
910
* 文 件 名:ImageGraphicsUtility.cs

src/JR.Stand.Core/Framework/InnerAppDomainResolver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.Reflection;
4+
using JR.Stand.Core.Utils;
45

56
namespace JR.Stand.Core.Framework
67
{

src/JR.Stand.Core/Framework/Web/Utils/FileUpload.cs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System;
99
using System.IO;
1010
using JR.Stand.Abstracts.Web;
11+
using JR.Stand.Core.Utils;
1112
using JR.Stand.Core.Web;
1213
using Microsoft.AspNetCore.Http;
1314

src/JR.Stand.Core/FwCtx.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using JR.Stand.Core.Framework;
3+
using JR.Stand.Core.Utils;
34

45
namespace JR.Stand.Core
56
{

src/JR.Stand.Core/PluginKernel/BasePluginHost.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Reflection;
55
using System.Text.RegularExpressions;
66
using JR.Stand.Core.Framework;
7+
using JR.Stand.Core.Utils;
78

89
namespace JR.Stand.Core.PluginKernel
910
{

src/JR.Stand.Core/PluginKernel/Logger.cs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text;
55
using JR.Stand.Core.Framework;
66
using JR.Stand.Core.Framework.Extensions;
7+
using JR.Stand.Core.Utils;
78

89
namespace JR.Stand.Core.PluginKernel
910
{

src/JR.Stand.Core/PluginKernel/PluginPackAttribute.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using JR.Stand.Core.Framework;
4+
using JR.Stand.Core.Utils;
45

56
namespace JR.Stand.Core.PluginKernel
67
{

src/JR.Stand.Core/Template/Impl/TemplatePage.cs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.IO;
1111
using System.Reflection;
1212
using System.Text;
13+
using JR.Stand.Core.Utils;
1314

1415
namespace JR.Stand.Core.Template.Impl
1516
{

src/JR.Stand.Core/Template/Impl/TemplateRegistry.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Collections.Generic;
1010
using System.IO;
1111
using System.Text.RegularExpressions;
12+
using JR.Stand.Core.Utils;
1213

1314
namespace JR.Stand.Core.Template.Impl
1415
{

src/JR.Stand.Core/Utils/EnvUtil.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Runtime.InteropServices;
33

4-
namespace JR.Stand.Core
4+
namespace JR.Stand.Core.Utils
55
{
66
public static class EnvUtil
77
{

src/JR.Stand.Core/Web/Cache/CacheFactory.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using JR.Stand.Abstracts;
1+
using System;
2+
using JR.Stand.Abstracts;
23
using JR.Stand.Core.Utils;
34
using JR.Stand.Core.Web.Cache.Component;
45

@@ -14,7 +15,7 @@ public static class CacheFactory
1415
/// <summary>
1516
///
1617
/// </summary>
17-
public static ICache Sington
18+
public static ICache Singleton
1819
{
1920
get
2021
{
@@ -24,7 +25,7 @@ public static ICache Sington
2425
}
2526

2627
public static void Configure(IMemoryCacheWrapper cache)
27-
{
28+
{
2829
_cacheInstance = new BasicCache(new DependCache(cache));
2930
}
3031
}

src/JR.Stand.Core/Web/Cache/CacheUpdateAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public CacheUpdateAttribute(CacheSign sign)
4343

4444
public void Clear()
4545
{
46-
CacheFactory.Sington.Clear(this.Key);
46+
CacheFactory.Singleton.Clear(this.Key);
4747
}
4848
}
4949
}
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using System;
2+
using JR.Stand.Core.Utils;
23

34
namespace JR.Stand.Core.Web.Cache
45
{
56
/// <summary>
67
///
78
/// </summary>
8-
internal class Variables
9+
internal static class Variables
910
{
10-
public static string PhysicPath = EnvUtil.GetBaseDirectory();
11+
public static readonly string PhysicPath = EnvUtil.GetBaseDirectory();
1112
}
1213
}

src/JR.Stand.Core/Web/HttpHostingImpl.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Runtime.InteropServices;
22
using JR.Stand.Abstracts;
3+
using JR.Stand.Core.Utils;
34
using Microsoft.AspNetCore.Hosting;
45
using Microsoft.AspNetCore.Http;
56
using Microsoft.Extensions.DependencyInjection;

src/JR.Stand.Core/Web/WebCtx.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using JR.Stand.Abstracts.Web;
55
using JR.Stand.Core.Framework.Web.Cache;
66
using JR.Stand.Core.PluginKernel.Web;
7+
using JR.Stand.Core.Utils;
78
using JR.Stand.Core.Web.Cache;
89
using JR.Stand.Core.Web.Cache.Component;
910
using JR.Stand.Core.Web.Plugin;
@@ -122,7 +123,7 @@ public IPluginApp<HttpContextImpl> Plugin
122123

123124
public ICache Cache
124125
{
125-
get { return CacheFactory.Sington; }
126+
get { return CacheFactory.Singleton; }
126127
}
127128

128129

src/JR.Stand.Toolkit/Crawl/Impl/WebManageHandler.cs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Web;
77
using JR.Stand.Core;
88
using JR.Stand.Core.Extensions.Http;
9+
using JR.Stand.Core.Utils;
910
using Microsoft.AspNetCore.Http;
1011

1112
namespace JR.Stand.Toolkit.Crawl.Impl

src/JR.Stand.Toolkit/HttpTag/HttpTags.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using JR.Stand.Core;
66
using Microsoft.AspNetCore.Http;
77
using JR.Stand.Core.Extensions.Http;
8+
using JR.Stand.Core.Utils;
89

910
namespace JR.Stand.Toolkit.HttpTag
1011
{

src/NetFx/JR.Cms.AspNet.App/Web.config

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
1616
可在 <httpRuntime> 标记上设置以下特性。
1717
<system.Web>
18-
<httpRuntime targetFramework="4.7.2" />
18+
<httpRuntime />
1919
</system.Web>
2020
-->
2121
<system.web>
22-
<httpRuntime targetFramework="4.5" executionTimeout="3600" maxRequestLength="1048576" requestValidationMode="2.0" />
22+
<httpRuntime executionTimeout="3600" maxRequestLength="1048576" requestValidationMode="2.0" />
2323
<customErrors mode="Off" />
2424
<pages validateRequest="false" controlRenderingCompatibilityVersion="4.0" />
25-
<compilation debug="true" targetFramework="4.5" />
25+
<compilation debug="false" />
2626
</system.web>
2727
<system.webServer>
2828
<security>

0 commit comments

Comments
 (0)