k-ujihara / NCDK

The Chemistry Development Kit ported to .NET
https://kazuyaujihara.github.io/NCDK/
GNU Lesser General Public License v2.1
35 stars 11 forks source link

Lack T4 Templating configuration #1

Closed JimSEOW closed 7 years ago

JimSEOW commented 7 years ago

The NCDK.sln file come without proper T4 Templating configuration. It would help other if there is instruction how to TextTransform all the .tt files before opening the NCDK.sln

[Failure] Could not find file 'NCDK\TT\ChemFile.tt.cs'.
[Failure] Could not find file 'NCDK\Hybridization.tt.cs'.
[Failure] Could not find file 'NCDK\Config\Elements.tt.cs'.
[Failure] Could not find file 'NCDK\TT\RingSet.tt.cs'.
[Failure] Could not find file 'NCDK\TT\SingleElectron.tt.cs'.
[Failure] Could not find file 'NCDK\BondOrder.tt.cs'.
[Failure] Could not find file 'NCDK\Numerics\Register.tt.cs'.
[Failure] Could not find file 'NCDK\Stereo\Projection.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Element.tt.cs'.
[Failure] Could not find file 'NCDK\TT\AdductFormula.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ReactionSet.tt.cs'.
[Failure] Could not find file 'NCDK\BondStereo.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Crystal.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ChemSequence.tt.cs'.
[Failure] Could not find file 'NCDK\TT\PDBStrand.tt.cs'.
[Failure] Could not find file 'NCDK\Numerics\Vector.tt.cs'.
[Failure] Could not find file 'NCDK\TT\AtomContainerSet.tt.cs'.
[Failure] Could not find file 'NCDK\TT\FragmentAtom.tt.cs'.
[Failure] Could not find file 'NCDK\TT\PDBStructure.tt.cs'.
[Failure] Could not find file 'NCDK\TT\EnzymeResidueLocator.tt.cs'.
[Failure] Could not find file 'NCDK\TT\LonePair.tt.cs'.
[Failure] Could not find file 'NCDK\Numerics\ConstantHelper.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Polymer.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Strand.tt.cs'.
[Failure] Could not find file 'NCDK\Hash\BasicAtomEncoder.tt.cs'.
[Failure] Could not find file 'NCDK\Smiles\CxSmilesState.tt.cs'.
[Failure] Could not find file 'NCDK\LibIO\CML\CMLFormula.tt.cs'.
[Failure] Could not find file 'NCDK\TetrahedralStereo.tt.cs'.
[Failure] Could not find file 'NCDK\TT\PDBMonomer.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ElectronContainer.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Association.tt.cs'.
[Failure] Could not find file 'NCDK\IHasProperties.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ChemModel.tt.cs'.
[Failure] Could not find file 'NCDK\SGroups\SgroupType.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Reaction.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Atom.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ReactionScheme.tt.cs'.
[Failure] Could not find file 'NCDK\TT\PDBPolymer.tt.cs'.
[Failure] Could not find file 'NCDK\LibIO\CML\CMLElementDefines.tt.cs'.
[Failure] Could not find file 'NCDK\Formula\MolecularFormula.tt.cs'.
[Failure] Could not find file 'NCDK\TT\BioPolymer.tt.cs'.
[Failure] Could not find file 'NCDK\TT\AtomType.tt.cs'.
[Failure] Could not find file 'NCDK\TT\PseudoAtom.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Substance.tt.cs'.
[Failure] Could not find file 'NCDK\TT\AminoAcid.tt.cs'.
[Failure] Could not find file 'NCDK\TT\PDBAtom.tt.cs'.
[Failure] Could not find file 'NCDK\LibIO\CML\CMLElementBodies.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ChemObjectBuilder.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Monomer.tt.cs'.
[Failure] Could not find file 'NCDK\SMSD\Algorithm.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Bond.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Mapping.tt.cs'.
[Failure] Could not find file 'NCDK\TT\ChemObject.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Isotope.tt.cs'.
[Failure] Could not find file 'NCDK\DoubleBondConformation.tt.cs'.
[Failure] Could not find file 'NCDK\TT\AtomContainer.tt.cs'.
[Failure] Could not find file 'NCDK\TT\Ring.tt.cs'.
k-ujihara commented 7 years ago

I added generated *.tt.cs codes to repository. Thanks.

JimSEOW commented 7 years ago

@kazuyaujihara Thank you for your prompt response. This is the script I use to generate *.tt.cs

For unknown reasons, it does not work. Could you please feedback. Thank you.

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

:: set the working dir (default to current dir)
set wdir=%cd%
if not (%1)==() set wdir=%1

:: set the file extension (default to tt.cs)
set extension=tt.cs
if not (%2)==() set extension=%2

echo executing transform_all from %wdir%
:: create a list of all the T4 templates in the working dir
dir %wdir%\*.tt /b /s > t4list.txt

echo the following T4 templates will be transformed:
type t4list.txt

:: transform all the templates
for /f %%d in (t4list.txt) do (
set file_name=%%d
set file_name=!file_name:~0,-6!.%extension%
echo:  \--^> !file_name!    
TextTransform.exe -out !file_name! %%d
)

echo transformation complete`
k-ujihara commented 7 years ago

@JimSEOW I could not catch what you want to do. Let me know the details like error messages.

JimSEOW commented 7 years ago

@kazuyaujihara

TextTransform.exe -out filename.tt filename.tt.cs does not work.I

Can you share how to generate *.tt.cs correctly?

k-ujihara commented 7 years ago

According to my research, TextTransform.exe only supports CR LF for eol. CRs might be removed through Git. .gitattributes file is changed to set proper eol.