dealogic / cloc-vsts-extension Goto Github PK
View Code? Open in Web Editor NEWBuild task for Visual Studio Team Services (VSTS) to count lines of code.
License: MIT License
Build task for Visual Studio Team Services (VSTS) to count lines of code.
License: MIT License
I've added cloc as a step in my build pipeline. It downloads successfully and then fails because it can't locate cloc.exe...
2019-01-15T19:04:11.9575687Z ##[section]Starting: Count lines of code...
2019-01-15T19:04:11.9579353Z ==============================================================================
2019-01-15T19:04:11.9579442Z Task : Count Lines of Code
2019-01-15T19:04:11.9579482Z Description : Count Lines of Code with cloc CLI by Al Danial.
2019-01-15T19:04:11.9579522Z Version : 1.1.2
2019-01-15T19:04:11.9579582Z Author : Dealogic
2019-01-15T19:04:11.9579621Z Help : More information cloc
2019-01-15T19:04:11.9579661Z ==============================================================================
2019-01-15T19:04:12.3336825Z task display name: Count lines of code...
2019-01-15T19:04:12.3346536Z working folder: D:\a\1\s
2019-01-15T19:04:12.3356697Z cloc-cli download url: https://github.com/AlDanial/cloc/releases/download/1.80/cloc-1.80.exe
2019-01-15T19:04:12.3358026Z arguments: --exclude-dir=.gitignore --exclude-ext=.md
2019-01-15T19:04:12.3368795Z Downloading cloc.exe from 'https://github.com/AlDanial/cloc/releases/download/1.80/cloc-1.80.exe'
2019-01-15T19:04:13.6897941Z Download is completed.
2019-01-15T19:04:13.6898354Z Executing command: cloc.exe --exclude-dir=.gitignore --exclude-ext=.md --sum-one --md --out cloc.result.md
2019-01-15T19:04:16.8508360Z ##[error]Unhandled: Command failed: cloc.exe --exclude-dir=.gitignore --exclude-ext=.md --sum-one --md --out cloc.result.md
cloc -- Count Lines of Code
Usage:
cloc.exe [options] <file(s)/dir(s)/git hash(es)>
Count physical lines of source code and comments in the given files
(may be archives such as compressed tarballs or zip files) and/or
recursively below the given directories or git commit hashes.
Example: cloc src/ include/ main.c
cloc.exe [options] --diff <set1> <set2>
Compute differences of physical lines of source code and comments
between any pairwise combination of directory names, archive
files or git commit hashes.
Example: cloc --diff Python-3.5.tar.xz python-3.6/
cloc.exe --help shows full documentation on the options.
http://github.com/AlDanial/cloc has numerous examples and more information.
TFS 2018 on Windows Server with node.js Latest LTS Version: 12.18.3 (includes npm 6.14.6):
2020-07-22T23:12:09.8281274Z task display name: cloc --windows .
2020-07-22T23:12:09.8286442Z working folder: C:\Msft_test\AgentSmith_work\1\s
2020-07-22T23:12:09.8344899Z cloc-cli download url: file://C:/cloc/cloc-1.86.exe
2020-07-22T23:12:09.8345511Z arguments: --windows .
2020-07-22T23:12:09.8345591Z Downloading cloc.exe from:
2020-07-22T23:12:09.8345752Z Url {
2020-07-22T23:12:09.8345822Z protocol: 'file:',
2020-07-22T23:12:09.8345890Z slashes: true,
2020-07-22T23:12:09.8345973Z auth: null,
2020-07-22T23:12:09.8346037Z host: 'c',
2020-07-22T23:12:09.8346101Z port: null,
2020-07-22T23:12:09.8346166Z hostname: 'c',
2020-07-22T23:12:09.8346493Z hash: null,
2020-07-22T23:12:09.8346560Z search: null,
2020-07-22T23:12:09.8346624Z query: null,
2020-07-22T23:12:09.8346711Z pathname: '/cloc/cloc-1.86.exe',
2020-07-22T23:12:09.8346785Z path: '/cloc/cloc-1.86.exe',
2020-07-22T23:12:09.8346858Z href: 'file://c/cloc/cloc-1.86.exe' }
2020-07-22T23:12:09.8346939Z Copying file from '//c/cloc/cloc-1.86.exe'
2020-07-22T23:12:09.8383559Z ##[error]cloc --windows . failed
2020-07-22T23:12:09.8403635Z ##[error]TypeError: fs.copyFile is not a function
2020-07-22T23:12:09.8403837Z TypeError: fs.copyFile is not a function
2020-07-22T23:12:09.8403946Z at Object.downloadClocCli [as default] (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\clocCliDownloader.js:16:20)
2020-07-22T23:12:09.8404106Z at C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:33:40
2020-07-22T23:12:09.8404193Z at next (native)
2020-07-22T23:12:09.8404295Z at C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:7:71
2020-07-22T23:12:09.8404401Z at __awaiter (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:3:12)
2020-07-22T23:12:09.8404530Z at run (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:15:12)
2020-07-22T23:12:09.8404642Z at Object. (C:\Msft_test\AgentSmith_work_tasks\cloc_7b598338-cf0d-4c3f-acc2-4967b6202533\1.2.1\index.js:47:1)
2020-07-22T23:12:09.8404751Z at Module._compile (module.js:570:32)
2020-07-22T23:12:09.8404831Z at Object.Module._extensions..js (module.js:579:10)
2020-07-22T23:12:09.8404918Z at Module.load (module.js:487:32)
From the log:
6/3/2018 8:57:44 PM - Microsoft VSIX Installer
6/3/2018 8:57:44 PM - -------------------------------------------
6/3/2018 8:57:44 PM - vsixinstaller.exe version:
6/3/2018 8:57:44 PM - 15.7.105+ga2c5d563c6
6/3/2018 8:57:44 PM - -------------------------------------------
6/3/2018 8:57:44 PM - Command line parameters:
6/3/2018 8:57:44 PM - C:\program files (x86)\microsoft visual studio\installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\rpeaugh\Downloads\Chrome\Dealogic.cloc-vsts-extension-1.0.0 (2).vsix
6/3/2018 8:57:44 PM - -------------------------------------------
6/3/2018 8:57:44 PM - Microsoft VSIX Installer
6/3/2018 8:57:44 PM - -------------------------------------------
6/3/2018 8:57:44 PM - Initializing Install...
6/3/2018 8:57:44 PM - Extension Details...
6/3/2018 8:57:44 PM - Identifier : cloc-vsts-extension
6/3/2018 8:57:44 PM - Name : Count Lines of Code
6/3/2018 8:57:44 PM - Author : Dealogic
6/3/2018 8:57:44 PM - Version : 1.0.0
6/3/2018 8:57:44 PM - Description : Count Lines of Code with cloc CLI by Al Danial.
6/3/2018 8:57:44 PM - Locale : en-US
6/3/2018 8:57:44 PM - MoreInfoURL :
6/3/2018 8:57:44 PM - InstalledByMSI : False
6/3/2018 8:57:44 PM - SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
6/3/2018 8:57:44 PM -
6/3/2018 8:57:44 PM - SignatureState : Unsigned
6/3/2018 8:57:44 PM - Supported Products :
6/3/2018 8:57:44 PM - Microsoft.VisualStudio.Services
6/3/2018 8:57:44 PM - Version :
6/3/2018 8:57:44 PM -
6/3/2018 8:57:44 PM - References :
6/3/2018 8:57:44 PM - Signature Details...
6/3/2018 8:57:44 PM - Extension is not signed.
6/3/2018 8:57:44 PM -
6/3/2018 8:57:44 PM - Searching for applicable products...
6/3/2018 8:57:44 PM - Found installed product - Global Location
6/3/2018 8:57:44 PM - Found installed product - Visual Studio Professional 2017
6/3/2018 8:57:44 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable1& skuData) at VSIXInstaller.App.Initialize(Boolean isRepairSupported) at VSIXInstaller.App.Initialize() at System.Threading.Tasks.Task
1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
No agent found in pool DartPool which satisfies the specified demands:
msbuild
DotNetFramework
vstest
node.js
Agent.Version -gtVersion 2.115.0
The only one of those "demands" that my build server might not meet is "node.js". If node.js is a dependency of this extension, then the installation instructions should include how to install it.
Hi,
I am using the Count Lines of Code plugin in my azure devops pipeline to count the lines for my javascript source code, however the tasks fails while uploading the file with below error.
Uploading result file from e:\cache\Agent03\11\s\cloc.result.md
##[error]Unable to process command '##vso[task.addattachment type=Distributedtask.Core.Summary;name=cloc e:\cache\Agent03\11\s\PSP.Web.UI\app\scripts\;]e:\cache\Agent03\11\s\cloc.result.md' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Name contains invalid characters. (", <, >, |, , �, �, �, �, �, �, �, �, ,
Attaching the screenshot of the values provided in the plugin for references, I want this plugin to display the result on the build summary.
I also noticed that this task by default creates the result in cloc.result.md file. I tried passing arguments explicitly by different file names but it still took the same file name.
If you have multiple "cloc" tasks, you don't know which one belongs to what. Having a title option would allow to see it in the summary.
To do it, simply add a new ## line on top of the cloc.result.md with the wished title
The cloc git download link was updated from .../download/vX.X/... to .../download/X.X/... Please correct the download script to account for this change as it causes the build step to fail. Manually changing the script in each task cache temporarily resolves the issue, but it would be great if that change could be applied to the task in the marketplace.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.