ritsu 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
data/lib/ritsu/project.rb
CHANGED
@@ -6,11 +6,13 @@ require File.expand_path(File.dirname(__FILE__) + '/utility/strings')
|
|
6
6
|
require File.expand_path(File.dirname(__FILE__) + '/src_files/project_cmake_lists')
|
7
7
|
require File.expand_path(File.dirname(__FILE__) + '/src_files/project_config_header_file')
|
8
8
|
require File.expand_path(File.dirname(__FILE__) + '/src_files/project_config_header_template_file')
|
9
|
+
require File.expand_path(File.dirname(__FILE__) + "/utility/accessors")
|
9
10
|
|
10
11
|
module Ritsu
|
11
12
|
class Project
|
12
13
|
include Ritsu::Utility::SingleInstance
|
13
14
|
include Ritsu::Utility::Strings
|
15
|
+
include Ritsu::Utility::Accessors
|
14
16
|
|
15
17
|
attr_reader :name
|
16
18
|
attr_reader :targets
|
@@ -20,6 +22,8 @@ module Ritsu
|
|
20
22
|
attr_reader :cmake_lists
|
21
23
|
attr_reader :config_header_file
|
22
24
|
attr_reader :config_header_template_file
|
25
|
+
attr_accessor :custom_script
|
26
|
+
attr_method :custom_script
|
23
27
|
|
24
28
|
def initialize_instance(name)
|
25
29
|
if !is_c_name?(name)
|
@@ -32,6 +36,7 @@ module Ritsu
|
|
32
36
|
@external_libraries = Set.new
|
33
37
|
@src_files = Set.new
|
34
38
|
@project_dir = File.expand_path('.')
|
39
|
+
@custom_script = ""
|
35
40
|
|
36
41
|
@cmake_lists = Ritsu::SrcFiles::ProjectCmakeLists.new(self)
|
37
42
|
@config_header_file = Ritsu::SrcFiles::ProjectConfigHeaderFile.new(self)
|
@@ -37,6 +37,18 @@ module Ritsu
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
class CustomScriptTemplate < Ritsu::Template
|
41
|
+
def initialize(project)
|
42
|
+
super("ProjectCmakeLists -- Custom Script")
|
43
|
+
@project = project
|
44
|
+
end
|
45
|
+
|
46
|
+
def update_block(block, options={})
|
47
|
+
block.contents.clear
|
48
|
+
block.contents << @project.custom_script
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
40
52
|
class ExternalLibrariesTemplate < Ritsu::Template
|
41
53
|
def initialize(project)
|
42
54
|
super("ProjectCmakeLists -- External Libraries")
|
@@ -97,6 +109,8 @@ module Ritsu
|
|
97
109
|
|
98
110
|
add_template HeaderTemplate.new(project)
|
99
111
|
add_new_line
|
112
|
+
add_template CustomScriptTemplate.new(project)
|
113
|
+
add_new_line
|
100
114
|
add_template ExternalLibrariesTemplate.new(project)
|
101
115
|
add_new_line
|
102
116
|
add_template DirectoriesTemplate.new(project)
|
@@ -60,6 +60,10 @@ ELSE(UNIX)
|
|
60
60
|
ENDIF(UNIX)
|
61
61
|
##>> ProjectCmakeLists -- Header
|
62
62
|
|
63
|
+
##<< ProjectCmakeLists -- Custom Script
|
64
|
+
|
65
|
+
##>> ProjectCmakeLists -- Custom Script
|
66
|
+
|
63
67
|
##<< ProjectCmakeLists -- External Libraries
|
64
68
|
##>> ProjectCmakeLists -- External Libraries
|
65
69
|
|
@@ -130,6 +134,10 @@ ELSE(UNIX)
|
|
130
134
|
ENDIF(UNIX)
|
131
135
|
##>> ProjectCmakeLists -- Header
|
132
136
|
|
137
|
+
##<< ProjectCmakeLists -- Custom Script
|
138
|
+
|
139
|
+
##>> ProjectCmakeLists -- Custom Script
|
140
|
+
|
133
141
|
##<< ProjectCmakeLists -- External Libraries
|
134
142
|
FIND_PACKAGE(OpenGL REQUIRED)
|
135
143
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ritsu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 0.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- dragonmeteor
|