canoe 0.3.2.2 → 0.3.2.3

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: 50752029532b56ce10a610ae7d9705212a1c424533ed2fde71a3133505c11d0e
4
- data.tar.gz: 501d882198eb59157961a741d786dbbe5c420e9d2704d37e7b1ca9a0f651854a
3
+ metadata.gz: '0518fcb695948644be7df59c7200eaf996a1c753bb8b575721764d36fcde61cb'
4
+ data.tar.gz: 385806c9e2035fa9c0cd1caf2556ca8aba1994ca73caad835f252003bbe1c36e
5
5
  SHA512:
6
- metadata.gz: 2da665d3e3ce5e073a207863fc2cc2f06a892d9e7889d3e0e29617c673c01d5aa503854c5effb80b34989b3cdf9743a1b8ada49c537920ba06f5ec1e5cd836c0
7
- data.tar.gz: 9d13815277a02e41a894cee4528c3742d35a6e81cbc84828a0f8dc857aae1c7356de4cc05511ca9145a2f4d2912315955746541bd47d35d949c38863d1ddecf7
6
+ metadata.gz: fe763993a442305afd7180eba5bb52fe63cd5ba9c8520c985a1cecec3ecbabb52296c5b6afd5ac7a72fa2341ebe432a6e7ca7b261145ca211dfc436f5066d22c
7
+ data.tar.gz: 9eb610ca364b557e9e1999c18dd497912503cdc0580f3f403ef3abf6f4ac58803b81d5a1c352f02e5e00685d6bb1e471866f33c3da2f12651063fb4e6a5f33bc
@@ -21,6 +21,7 @@ module Canoe
21
21
  # args are commandline parameters passed to `canoe build`,
22
22
  # could be 'all', 'test', 'target', 'base' or empty
23
23
  def build(arg = 'target')
24
+ build_compiler_from_config
24
25
  send "build_#{arg}"
25
26
  end
26
27
 
@@ -132,8 +133,6 @@ module Canoe
132
133
  build_time = File.exist?(target) ? File.mtime(target) : Time.new(0)
133
134
  files = DepAnalyzer.compiling_filter target_deps, build_time, @source_suffix, @header_suffix
134
135
 
135
- build_compiler_from_config
136
-
137
136
  if files.empty? && File.exist?(target)
138
137
  puts "nothing to do, all up to date"
139
138
  return true
@@ -145,7 +144,6 @@ module Canoe
145
144
  # generate a compile_commands.json file
146
145
  def build_base
147
146
  deps = target_deps.merge tests_deps
148
- build_compiler_from_config
149
147
  database = CompilationDatabase.new
150
148
  deps.each_key do |k|
151
149
  next if k.end_with? @header_suffix
@@ -45,10 +45,18 @@ module Canoe
45
45
  end
46
46
 
47
47
  def test_single(name)
48
+ rebuild = false;
48
49
  bin = "#{@target_short}/test_#{name}"
50
+ rebuild ||= !File.exist?(bin)
51
+
49
52
  file = "#{@tests_short}/test_#{name}.#{@source_suffix}"
50
- abort_on_err "Can not find source file #{file.red} for test #{name.red}" unless File.exist?(file)
51
- build_one_test(file, fetch_all_deps) unless File.exist?(bin)
53
+
54
+ deps = fetch_all_deps
55
+ extract_one_file(file, deps).push(file).each do |f|
56
+ rebuild ||= File.mtime(bin) < File.mtime(f)
57
+ end
58
+
59
+ build_compiler_from_config && build_one_test(file, deps) if rebuild
52
60
 
53
61
  issue_command bin
54
62
  end
@@ -2,7 +2,7 @@ module Canoe
2
2
  class WorkSpace
3
3
  def self.version
4
4
  puts <<~VER
5
- canoe v0.3.2.2
5
+ canoe v0.3.2.3
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.2.2
4
+ version: 0.3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - XIONG Ziwei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-05-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |+
14
14
  Canoe offers project management and building facilities to C/C++ projects.