Skip to content

Commit

Permalink
- в пакет NuGet включён msi непосредственно (#149) (для облегчения те…
Browse files Browse the repository at this point in the history
…стирования)
  • Loading branch information
sergey-s-betke committed Jul 25, 2016
1 parent 4d56077 commit d19b60a
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
35 changes: 32 additions & 3 deletions ITG.MakeUtils/chocolatey.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ ITG_MAKEUTILS_DIR ?= $(MAKE_CHOCOLATEY_DIR)
include $(realpath $(ITG_MAKEUTILS_DIR)/common.mk)

CHOCO ?= choco

NUGET ?= nuget
CHOCOPKGUP ?= chocopkgup

OUTPUTDIR := $(SOURCESDIR)/_output
#OUTPUTDIR := $(SOURCESDIR)/_output

# $(call calcChocoPackageFileName, packageId, packageVersion)
calcChocoPackageFileName = $1.$2.nupkg

# $(call packChocoWebPackage, id, packageId, chocoPkgUpArgs, packageVersion, Dependencies)
# $(call packChocoWebPackageAux, id, packageId, chocoPkgUpArgs, packageVersion, Dependencies)
define packChocoWebPackageAux

export $(1)TARGETS ?= $(OUTPUTDIR)/$2/$$($(1)VERSION)/$(call calcChocoPackageFileName,$2,$$($(1)VERSION))
Expand Down Expand Up @@ -45,4 +45,33 @@ packChocoWebPackage = $(call packChocoWebPackageAux,$1,$2,,$3,$4)
# $(call packChocoMSIWebPackage, id, packageId, productCode, packageVersion, Dependencies)
packChocoMSIWebPackage = $(call packChocoWebPackageAux,$1,$2,--packageguid=$3,$4,$5)

# $(call packChocoPackageAux, id, packageId, installerArgs, packageVersion, dependencies)
define packChocoPackageAux

export $(1)TARGETS ?= $(OUTPUTDIR)/$2/$$($(1)VERSION)/$(call calcChocoPackageFileName,$2,$$($(1)VERSION))
$(call declareGlobalTargets,$(1)TARGETS)
$(1)NUSPEC ?= $(wildcard $(SOURCESDIR)/$2/*.nuspec)
$(1)TOOLS ?= $(wildcard $(SOURCESDIR)/$2/chocolatey*.ps1)
$(1)VERSION ?= $4

$$($(1)TARGETS): $$($(1)NUSPEC) $$($(1)TOOLS) $5
$$(info Generate chocolatey package file "$$@"...)
$$(MAKETARGETDIR)
$$(NUGET) \
pack $$< \
-OutputDirectory $$(@D) \
-Version $$($(1)VERSION) \
-Verbosity detailed \
-NoPackageAnalysis \
-NonInteractive
@touch $$@

.PHONY: $1
$(1): $$($(1)TARGETS)

endef

# $(call packChocoMSIPackage, id, packageId, productCode, packageVersion, Dependencies)
packChocoMSIPackage = $(call packChocoPackageAux,$1,$2,,$4,$5)

endif
1 change: 1 addition & 0 deletions setup/chocolatey/font.gost2.304-81.install/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/sources/*/*.msi
9 changes: 8 additions & 1 deletion setup/chocolatey/font.gost2.304-81.install/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ include $(ITG_MAKEUTILS_DIR)/gitversion.mk
include $(ITG_MAKEUTILS_DIR)/chocolatey.mk
include $(ITG_MAKEUTILS_DIR)/appveyor.mk

$(eval $(call packChocoMSIWebPackage,CHOCO_FONTS_INSTALL_PACKAGE_,font.gost2.304-81.install,$(ProductCode),$(MajorMinorPatch),$(msiTARGETS)))
CHOCO_PACKAGE_NAME = font.gost2.304-81.install
CHOCO_PACKAGE_INSTALLER = $(SOURCESDIR)/$(CHOCO_PACKAGE_NAME)/$(notdir $(msiTARGETS))

$(eval $(call copyfile,$(CHOCO_PACKAGE_INSTALLER),$(msiTARGETS)))
$(eval $(call packChocoMSIPackage,CHOCO_FONTS_INSTALL_PACKAGE_,$(CHOCO_PACKAGE_NAME),$(ProductCode),$(MajorMinorPatch),$(CHOCO_PACKAGE_INSTALLER)))

all: choco.fonts.install
choco.fonts.install: $(CHOCO_FONTS_INSTALL_PACKAGE_TARGETS)
$(pushDeploymentArtifact)

clean::
rm -f $(SOURCESDIR)/$(CHOCO_PACKAGE_NAME)/*.msi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Install-ChocolateyPackage `
-packageName '{{PackageName}}' `
Install-ChocolateyInstallPackage `
-packageName $env:chocolateyPackageName `
-installerType msi `
-silentArgs "/qn /norestart /l*v `"$env:TEMP\chocolatey\{{PackageName}}.{{PackageVersion}}\MsiInstall.log`"" `
-url "https://github.com/Metrolog/Font.GOST2.304-81/releases/download/v{{PackageVersion}}/GOST2.304-81.msi" `
-silentArgs '/qn /norestart' `
-filePath ( ( Get-Item '*.msi' )[0].Name ) `
-validExitCodes = @(0, 3010, 1641) `
;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Uninstall-ChocolateyPackage `
-packageName '{{PackageName}}' `
-packageName $env:chocolateyPackageName `
-installerType msi `
-silentArgs "{{PackageGUID}} /qn /norestart /l*v `"$env:TEMP\chocolatey\{{PackageName}}.{{PackageVersion}}\MsiUninstall.log`"" `
-silentArgs "$( ( Get-Item '*.msi' )[0].Name ) /qn /norestart" `
-validExitCodes = @(0, 3010, 1641) `
;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>font.gost2.304-81.install</id>
<version>{{PackageVersion}}</version>
<version>$version$</version>
<title>Fonts GOST 2.304-81 (Install)</title>
<authors>Sergey S. Betke</authors>
<owners>Sergey S. Betke</owners>
Expand All @@ -14,7 +14,7 @@ MSI installer for GOST 2.304-81 true type fonts.
</description>
<summary>MSI installer for GOST 2.304-81 true type fonts</summary>
<releaseNotes>
All release notes can be found on the GitHub site - https://github.com/Metrolog/Font.GOST2.304-81/releases/v{{PackageVersion}}
All release notes can be found on the GitHub site - https://github.com/Metrolog/Font.GOST2.304-81/releases/v$version$
</releaseNotes>
<tags>font GOST 2.304-81 ttf</tags>
<dependencies>
Expand Down

0 comments on commit d19b60a

Please sign in to comment.