-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from dlidstrom/docker-image
Small docker image
- Loading branch information
Showing
4 changed files
with
134 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Duplo (C/C++/Java Duplicate Source Code Block Finder) | ||
|
||
This project is found in GitHub: [https://github.com/dlidstrom/Duplo](https://github.com/dlidstrom/Duplo). | ||
|
||
## General Information | ||
|
||
Duplicated source code blocks can harm maintainability of software systems. | ||
Duplo is a tool to find duplicated code blocks in large C, C++, Java, C# and | ||
VB.Net systems. | ||
|
||
## Maintainer | ||
|
||
Duplo was originally developed by Christian | ||
M. Ammann and is now maintained and developed by Daniel | ||
Lidström. | ||
|
||
## Usage | ||
|
||
Duplo works with a list of files. You can either specify a file that contains the list of files, or you can pass them using `stdin`. | ||
|
||
Run `duplo --help` on the command line to see the detailed options. | ||
|
||
### Passing files using `stdin` | ||
|
||
```bash | ||
# unix | ||
> find . \( -iname "*.cpp" -o -iname "*.h" \) | docker run dlidstrom/duplo - out.txt | ||
|
||
# windows | ||
> Get-ChildItem -Include "*.cpp", "*.h" -Recurse | % { $_.FullName } | docker run dlidstrom/duplo - out.txt | ||
``` | ||
`duplo` will write the duplicated blocks into `out.txt`. | ||
### Passing files using file | ||
`duplo` can analyze files specified in a separate file: | ||
```bash | ||
# unix | ||
> find . -type f \( -iname "*.cpp" -o -iname "*.h" \) > files.lst | ||
> docker run dlidstrom/duplo files.lst out.txt | ||
|
||
# windows | ||
> Get-ChildItem -Include "*.cpp", "*.h" -Recurse | % { $_.FullName } | Out-File -encoding ascii files.lst | ||
> docker run dlidstrom/duplo.exe files.lst out.txt | ||
``` | ||
## Feedback and Bug Reporting | ||
Please open a GitHub issue to discuss feedback, | ||
feature requests and bug reports. | ||
## License | ||
Duplo is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
Duplo is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with Duplo; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM alpine:3.11 AS build | ||
ARG DUPLO_VERSION=v1.0.0 | ||
|
||
RUN apk --no-cache add \ | ||
alpine-sdk cmake | ||
|
||
RUN mkdir -p /usr/src/ && \ | ||
git clone https://github.com/dlidstrom/Duplo /usr/src/Duplo | ||
|
||
WORKDIR /usr/src/Duplo | ||
|
||
RUN mkdir build && \ | ||
cd build && \ | ||
cmake .. -DDUPLO_VERSION=\"$DUPLO_VERSION\" && \ | ||
make | ||
|
||
FROM alpine:3.11 | ||
|
||
RUN apk --no-cache add libstdc++ | ||
|
||
COPY --from=build /usr/src/Duplo/build/duplo . | ||
|
||
ENTRYPOINT ["./duplo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters