canoe 0.3.3.7 → 0.3.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31786230f3242408570eab8fa5c5c7a51fa1e3ca7fe5b0edabe6789a4a1b311a
4
- data.tar.gz: 68ef217e2f6ac77d17ebe14ef3658c2002b8a6f5d0fed5090292cdb21b16b21c
3
+ metadata.gz: aa7b88d374db4b819dc680be67aa6320869e7cfdd08866baa889264e068792d7
4
+ data.tar.gz: 7c30628f907145f4c1d71ceb410cf1b84cf14eb48614eec297d02f06875147d5
5
5
  SHA512:
6
- metadata.gz: c089ec6a65599754ef177bbe8f14e71195d0d019ee9df3aa4a8414c1204055058f5b7a7e542a9dc43917b85c84e55907da60c8a2aeccb1d3271f02bead5d6c68
7
- data.tar.gz: ca6a203ad8bed8382cb8b3ee5d5ba567de8462bcc611d4a603c43159c98352cec40a9eec1f35d67369f5d33da696a2a46ca15627ffe34a50b1cc8cc07fa91340
6
+ metadata.gz: '05867ae57be308d052e77fa68efa0bfd0a964b423b4c6843f4476cedc84ebbe85eba7a085d980413f240533f0b92e2af33ce551a659305eaf47d3ad2a594032e'
7
+ data.tar.gz: 4c3dd9afe36b4ee30350ad914063d8a739e693e8dab516fe22f664ae9fb0ab3a0e0ec8095eae0f5a1bd9a2d4be348ab535f276ce9ad04654dab5aaddcd1dcd90
data/lib/default_files.rb CHANGED
@@ -10,6 +10,18 @@ class DefaultFiles
10
10
  end
11
11
  end
12
12
 
13
+ def create_clang_format(path)
14
+ open_file_and_write(
15
+ "#{path}/.clang-format",
16
+ <<~CLANG
17
+ BasedOnStyle: LLVM
18
+ IndentWidth: 4
19
+ ColumnLimit: 86
20
+ NamespaceIndentation: All
21
+ CLANG
22
+ )
23
+ end
24
+
13
25
  def create_config(path, compiler = 'clang++', src_sfx = 'cpp', hdr_sfx = 'hpp')
14
26
  open_file_and_write(
15
27
  "#{path}/config.json",
@@ -66,6 +66,7 @@ module Canoe
66
66
  end
67
67
 
68
68
  def link_exectutable(odir, objs)
69
+ puts "#{'[LINKING TARGET]'.magenta}..."
69
70
  puts "#{"[100%]".green} linking"
70
71
  @compiler.link_executable "#{odir}/#{@name}", objs
71
72
  end
@@ -97,6 +98,7 @@ module Canoe
97
98
  end
98
99
 
99
100
  def build_common(files)
101
+ return true if files.empty?
100
102
  all = SourceFiles.get_all(@src_short) { |f| f.end_with? @source_suffix }
101
103
  stepper = Stepper.new all.size, files.size
102
104
  flag = true
@@ -138,8 +140,7 @@ module Canoe
138
140
  files = DepAnalyzer.compiling_filter(target_deps, build_time, @source_suffix, @header_suffix)
139
141
 
140
142
  if files.empty? && File.exist?(target)
141
- puts "nothing to do, all up to date"
142
- return true
143
+ puts "nothing to compile, trying to link"
143
144
  end
144
145
 
145
146
  self.send "build_#{@mode.to_s}", files
@@ -169,7 +170,7 @@ module Canoe
169
170
  end
170
171
 
171
172
  def add_command_object(dir, arguments, file)
172
- temp = {
173
+ temp = {
173
174
  "arguments" => arguments,
174
175
  "directory" => dir,
175
176
  "file" => file
data/lib/workspace/new.rb CHANGED
@@ -26,6 +26,7 @@ module Canoe
26
26
  Dir.chdir(@workspace) do
27
27
  issue_command 'git init'
28
28
  issue_command 'canoe add tests'
29
+ DefaultFiles.create_clang_format @workspace
29
30
  end
30
31
  puts "workspace #{@workspace.blue} is created"
31
32
  end
@@ -66,7 +66,8 @@ module Canoe
66
66
  end
67
67
 
68
68
  def test_single(name, args = "")
69
- rebuild = false;
69
+ puts "[COMPILING TEST #{name}]".magenta
70
+ rebuild = false
70
71
  bin = "#{@target_short}/test_#{name}"
71
72
 
72
73
  rebuild ||= !File.exist?(bin)
@@ -82,11 +83,13 @@ module Canoe
82
83
  end
83
84
 
84
85
  cmd = "#{bin} #{args}"
86
+ build_compiler_from_config
85
87
  if rebuild
86
- build_compiler_from_config
87
88
  run_command cmd if build_one_test(file, deps)
88
89
  else
89
- run_command cmd
90
+ puts "nothing to compile, all up to date"
91
+ puts "[RELINKING...]".magenta
92
+ run_command cmd if link_one_test(file, deps)
90
93
  end
91
94
  end
92
95
 
@@ -2,7 +2,7 @@ module Canoe
2
2
  class WorkSpace
3
3
  def self.version
4
4
  puts <<~VER
5
- canoe v0.3.3.7
5
+ canoe v0.3.3.10
6
6
  For features in this version, please visit https://github.com/Dicridon/canoe
7
7
  Currently, canoe can do below:
8
8
  - project creation
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3.7
4
+ version: 0.3.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - XIONG Ziwei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |+
14
14
  Canoe offers project management and building facilities to C/C++ projects.