Skip to content

Commit

Permalink
chg: dev: make sure everybody has a version, fix msvc bat file
Browse files Browse the repository at this point in the history
* add git dep for build-deb-action container versioning
* remove exrtraneous make step in debian/rules,	add explicit target
* remove erroneous cleaning of version file from batch file
* add gh-describe action and pass version to batch file
* give mingw some fetch-depth or install git in specific runner envs
* convert readme to rst (needs render check)

Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Nov 17, 2022
1 parent cf4557b commit 9ecd093
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 42 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,16 @@ jobs:
with:
fetch-depth: 0

- name: Get version
id: get_version
run: |
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
echo ${{ env.VERSION }}
- name: Git describe
id: ghd
uses: proudust/gh-describe@v1

- name: Install and setup MSYS2 mingw
if: runner.os == 'Windows' && matrix.compiler == 'mingw-w64'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-toolchain make gcc diffutils
install: mingw-w64-x86_64-toolchain make gcc diffutils git

- name: Build and test windows mingw
if: runner.os == 'Windows' && matrix.compiler == 'mingw-w64'
Expand All @@ -89,7 +87,7 @@ jobs:
- name: Build and test windows MSVC
if: runner.os == 'Windows' && matrix.compiler == 'cl'
run: |
.\build_msvc.bat --version ${{ env.VERSION }}
.\build_msvc.bat --version ${{ steps.ghd.outputs.describe }}
- name: Install and setup Linux packages
if: runner.os == 'Linux'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/debs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
with:
docker-image: "debian:${{ matrix.dist }}-slim"
buildpackage-opts: --build=binary --no-sign
extra-build-deps: git

- name: Upload deb files
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
with:
docker-image: "debian:${{ matrix.dist }}-slim"
buildpackage-opts: --build=binary --no-sign
extra-build-deps: git

- name: Upload deb files
uses: actions/upload-artifact@v3
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ jobs:
with:
fetch-depth: 0

- name: Get version
id: get_version
run: |
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
echo ${{ env.VERSION }}
- name: Add 64-bit mingw-w64 to the PATH
run: |
echo "c:/msys64/bin;c:/msys64/mingw64/bin" >> $GITHUB_PATH
Expand All @@ -41,20 +35,21 @@ jobs:
- name: run test
run: |
make test
./cccc/cccc --version
windows:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Git describe
id: ghd
uses: proudust/gh-describe@v1

- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1

- name: Build
run: |
.\build_msvc.bat --version ${{ env.VERSION }}
.\build_msvc.bat --version ${{ steps.ghd.outputs.describe }}
.\cccc.exe --version
78 changes: 57 additions & 21 deletions README.md → README.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
README for CCCC versions 3.2.x
==============================

[![Github CI](https://github.com/sarnold/cccc/actions/workflows/ci.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/ci.yml)
[![Conda CI](https://github.com/sarnold/cccc/actions/workflows/conda.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/conda.yml)
[![Debian packages](https://github.com/sarnold/cccc/actions/workflows/debs.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/debs.yml)
[![Release CI](https://github.com/sarnold/cccc/actions/workflows/release.yml/badge.svg)](https://github.com/sarnold/cccc/actions/workflows/release.yml)
|ci| |conda| |debs| |release|

[![CCCC License](https://img.shields.io/badge/license-GPL2-green.svg?dummy)](https://github.com/sarnold/cccc/blob/master/cccc/COPYING)
![GitHub tag (latest SemVer pre-release)](https://img.shields.io/github/v/tag/sarnold/cccc?include_prereleases)
[![Github Issues](https://img.shields.io/github/issues/sarnold/cccc)](https://github.com/sarnold/cccc/issues?q=is:issue+is:open)
|tag| |license| |issues|

[![Conda Version](https://img.shields.io/conda/vn/conda-forge/cccc.svg)](https://anaconda.org/conda-forge/cccc)
[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/cccc.svg)](https://anaconda.org/conda-forge/cccc)
|vconda| |pconda|

What is it?
-----------

This is a maintenance update of the last (sourceforge) release of the program
CCCC (C and C++ Code Counter). This software performs analysis and reports
Expand All @@ -21,12 +18,22 @@ Ada95, which were supported in previous versions are presently not supported
new site for CCCC development is: https://github.com/sarnold/cccc and for
current documentation see: http://sarnold.github.io/cccc/

* [Github Action](https://github.com/marketplace/actions/cccc-action) - Now available as a github action!
* [Quick Install](https://github.com/sarnold/cccc/blob/master/README_install.rst) - Quick start install instructions
* [User Guide](http://sarnold.github.io/cccc/CCCC_User_Guide.html) - User guide (updated)
* [Release Notes](https://github.com/sarnold/cccc/blob/master/CHANGELOG.md) - Autogenerated changelog for github releases (with a little SVN history for context)
* [Software API docs](http://sarnold.github.io/cccc/api/html/index.html) - Software API documentation with design diagrams, etc
* [Complexity Metrics](http://sarnold.github.io/cccc/metrics/cccc.html) - Source code metrics for a source code metrics tool... ;)
* `Github Action`_ - Now available as a github action!
* `Quick Install`_ - Quick start install instructions
* `User Guide`_ - User guide (updated)
* `Release Notes`_ - Autogenerated changelog for github releases (with a little SVN history for context)
* `Software API docs`_ - Software API documentation with design diagrams, etc
* `Complexity Metrics`_ - Source code metrics for a source code metrics tool... ;)

.. _Github Action: https://github.com/marketplace/actions/cccc-action
.. _Quick Install: https://github.com/sarnold/cccc/blob/master/README_install.rst
.. _User Guide: http://sarnold.github.io/cccc/CCCC_User_Guide.html
.. _Release Notes: https://github.com/sarnold/cccc/blob/master/CHANGELOG.md
.. _Software API docs: http://sarnold.github.io/cccc/api/html/index.html
.. _Complexity Metrics: http://sarnold.github.io/cccc/metrics/cccc.html

Background
----------

CCCC is a command line tool, originally implemented for Linux and other
POSIX-style platforms, but also buildable on the Win32 platform. Files
Expand Down Expand Up @@ -67,6 +74,9 @@ to which you have and whether it is installed at the default position
in the filesystem). On Linux and similar platforms the shell script
build_posixgcc.sh should still work.
Historical
----------

As of the last upstream release (ver 3.1.4) the reference build tool for the
Win32 platform is the freely distributed Microsoft Visual C++ Toolkit 2003.
As this toolkit does not contain a 'make' style program the script
Expand Down Expand Up @@ -125,7 +135,10 @@ domain with no restrictions, other than the pious hope that should anyone
base a derivative work on it I will be given due credit. The current version
is released under the GNU Public License (including the bundled PCCTS source).

The upcoming 3.1.5 release will be a maintenance release to clean up the build and
Notes from the maintainer
-------------------------

The initial 3.1.5 release was a maintenance release to clean up the build and
makefile config (enabling parallel make) and fix a build error with recent gcc.
The pccts build target "mini" builds only the tools required to build cccc,
while the make target "pccts" builds the complete toolset, and "all" will build
Expand All @@ -137,10 +150,8 @@ of (expensive) commercial engineering tools. It has a simple CLI and other
support like Jenkins plugins. Use it to find out your own complexity metrics.
You might be surprised...

The above updates by Stephen L Arnold.

Notes from the original author
==============================
------------------------------

CCCC was originally developed as a proof-of-concept tool for some ideas
relating to software metrics which I was investigating as an academic
Expand Down Expand Up @@ -169,13 +180,38 @@ available for the forseeable future from https://github.com/sarnold/cccc
as well as the original home at http://cccc.sourceforge.net


.. |ci| image:: https://github.com/sarnold/cccc/actions/workflows/ci.yml/badge.svg
:target: https://github.com/sarnold/cccc/actions/workflows/ci.yml
:alt: CI Status

.. |conda| image:: https://github.com/sarnold/cccc/actions/workflows/conda.yml/badge.svg
:target: https://github.com/sarnold/cccc/actions/workflows/conda.yml
:alt: Conda Status

.. |ci| image:: https://github.com/sarnold/cccc/actions/workflows/debs.yml/badge.svg
:target: https://github.com/sarnold/cccc/actions/workflows/release.yml
:alt: Debian packages

.. |release| image:: https://github.com/sarnold/cccc/actions/workflows/release.yml/badge.svg
:target: https://github.com/sarnold/cccc/actions/workflows/release.yml
:alt: Release Status

.. |license| image:: https://img.shields.io/badge/license-GPL2-green.svg?dummy
:target: https://github.com/sarnold/cccc/blob/master/cccc/COPYING
:alt: License

.. |tag| image:: https://img.shields.io/github/v/tag/sarnold/cccc?include_prereleases
:target: https://github.com/sarnold/cccc/releases
:alt: GitHub tag (latest SemVer pre-release)

.. |issues| image:: https://img.shields.io/github/issues/sarnold/cccc
:target: https://github.com/sarnold/cccc/issues?q=is:issue+is:open
:alt: Issues

.. |vconda| image:: https://img.shields.io/conda/vn/conda-forge/cccc.svg
:target: https://anaconda.org/conda-forge/cccc
:alt: Conda Version



.. |pconfa| image:: https://img.shields.io/conda/pn/conda-forge/cccc.svg
:target: https://anaconda.org/conda-forge/cccc
:alt: Conda Platforms
1 change: 0 additions & 1 deletion build_msvc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ if "%arg1%"=="--clean" (
for %%d in ( pccts\dlg pccts\antlr cccc ) do (
if exist %%d\*.obj del %%d\*.obj
if exist %%d\*.exe del %%d\*.exe
if exist %%d\cccc_ver.h del %%d\cccc_ver.h
)
if exist pccts\bin rmdir /s /q pccts\bin
mkdir pccts\bin
Expand Down
2 changes: 1 addition & 1 deletion debian/docs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
README.md
README.rst
3 changes: 1 addition & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ CFLAGS += -c -I/usr/include/pccts -x c++
buildflags := CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"

override_dh_auto_build:
$(MAKE) -C cccc -f rules.mak cccc_ver.h
$(MAKE) -C cccc -f posixgcc.mak $(buildflags) \
PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS)
PCCTS_H=/usr/include/pccts PCCTS_BIN=/usr/bin $(CROSS) cccc

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
Expand Down

0 comments on commit 9ecd093

Please sign in to comment.