Class: AlpacaBuildTool::ProjectPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/alpacabuildtool/package_types/project_package.rb

Overview

ProjectPackage provides configuration of normal nuget packages created from projects

Instance Method Summary collapse

Constructor Details

#initialize(_, project, debug) ⇒ ProjectPackage

Creates an instance

package_id

not used in current class, but need to be here for

consistent interface with other package types

project

project to be used to create a package

debug

is debug configuration should be used to create a package


13
14
15
16
17
18
19
# File 'lib/alpacabuildtool/package_types/project_package.rb', line 13

def initialize(_, project, debug)
  @nuspec_file = File.join(project.dir, "#{project.name}.nuspec")
  @readme_file = File.join(project.dir, 'README.txt')
  @changelog_file = File.join(project.dir, 'CHANGES.txt')
  @file = project.file
  @debug = debug
end

Instance Method Details

#add_files?Boolean

Returns true so Nuspec file creation process will store readme and changelog files into <files/> entry

This is required for normal packages as they are created from *.csproj but adding them for :tool packages cause missing all other files as :tool package is created from folder and not *.csproj

Returns:

  • (Boolean)

40
41
42
# File 'lib/alpacabuildtool/package_types/project_package.rb', line 40

def add_files?
  true
end

#filesObject

Returns array of files: *.nuspec, CHANGELOG.txt, README.txt


23
24
25
# File 'lib/alpacabuildtool/package_types/project_package.rb', line 23

def files
  [@nuspec_file, @changelog_file, @readme_file]
end

#optionsObject

Returns options to be passed to Nuget.pack


29
30
31
# File 'lib/alpacabuildtool/package_types/project_package.rb', line 29

def options
  [@file, @debug ? 'Debug' : 'Release']
end