-
Notifications
You must be signed in to change notification settings - Fork 73
/
trivial.rb
executable file
·36 lines (35 loc) · 1013 Bytes
/
trivial.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/local/bin/ruby
all = Hash.new
list = `find . -name Android.mk`.split("\n")
list.each { |l|
next if ((l =~ /^\.\/jni\/vlc\/modules/) == nil)
temp = l.scan(/modules\/([^\/]+)\//)
next if temp == nil || temp.size == 0
t = temp[0][0].to_s
all[t] = Array.new if !all.has_key?(t)
File.open(l) { |f|
while !f.eof?
ln = f.readline
next if ((ln =~ /^LOCAL_MODULE/) == nil)
temp = ln.scan(/\s*LOCAL_MODULE\s*:=\s*([^\s]+)/)
next if temp == nil || temp.size == 0
name = temp[0][0].to_s
name = name[3..-1] if (name =~ /^lib/) != nil
n = 'lib' + name + '.so'
all[t].push(n)
end
}
}
all.each { |k, a|
`mkdir -p assets/lib/#{k}`
a.each { |v|
`mv libs/armeabi/#{v} assets/lib/#{k}`
}
}
`rm -f assets/index.txt`
list = `cd assets && find . -type f`.split("\n")
File.open('assets/index.txt', 'w') { |f|
list.each { |l|
f.write(l[2..-1] + "\n")
}
}