[Ttssh2-commit] [3236] SVN リビジョンを表示するプログラムを作成し、ttpdlg のビルド前イベントで svnversion . h に落とすようにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 26日 (木) 00:39:23 JST


Revision: 3236
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3236
Author:   maya
Date:     2009-03-26 00:39:23 +0900 (Thu, 26 Mar 2009)

Log Message:
-----------
SVN リビジョンを表示するプログラムを作成し、ttpdlg のビルド前イベントで svnversion.h に落とすようにした。
 これで OK なら svnversion.h を SVN 管理から外せるはず。

Modified Paths:
--------------
    trunk/teraterm/ttermpro.sln
    trunk/teraterm/ttpdlg/ttpdlg.vcproj

Added Paths:
-----------
    trunk/teraterm/svnrev/
    trunk/teraterm/svnrev/stdafx.cpp
    trunk/teraterm/svnrev/stdafx.h
    trunk/teraterm/svnrev/svnrev.cpp
    trunk/teraterm/svnrev/svnrev.h
    trunk/teraterm/svnrev/svnrev.vcproj


-------------- next part --------------
Added: trunk/teraterm/svnrev/stdafx.cpp
===================================================================
--- trunk/teraterm/svnrev/stdafx.cpp	                        (rev 0)
+++ trunk/teraterm/svnrev/stdafx.cpp	2009-03-25 15:39:23 UTC (rev 3236)
@@ -0,0 +1 @@
+#include "stdafx.h"

Added: trunk/teraterm/svnrev/stdafx.h
===================================================================
--- trunk/teraterm/svnrev/stdafx.h	                        (rev 0)
+++ trunk/teraterm/svnrev/stdafx.h	2009-03-25 15:39:23 UTC (rev 3236)
@@ -0,0 +1,11 @@
+#pragma once
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN
+#endif
+
+#include <afx.h>
+#include <afxwin.h>

Added: trunk/teraterm/svnrev/svnrev.cpp
===================================================================
--- trunk/teraterm/svnrev/svnrev.cpp	                        (rev 0)
+++ trunk/teraterm/svnrev/svnrev.cpp	2009-03-25 15:39:23 UTC (rev 3236)
@@ -0,0 +1,62 @@
+#include "stdafx.h"
+#include "svnrev.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+CWinApp theApp;
+
+using namespace std;
+
+int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
+{
+	int nRetCode = 0;
+	int revision = -1;
+
+	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
+	{
+		nRetCode = 1;
+	}
+	else
+	{
+		BOOL ret;
+		CStdioFile csf;
+		CString cs;
+		int format = -1;
+		
+		// [root dir]\.svn\entries
+		ret = csf.Open("..\\..\\.svn\\entries", CFile::modeRead);
+		if (ret == FALSE) {
+			nRetCode = 1;
+		}
+		else {
+			csf.SeekToBegin();
+
+			// line 1
+			csf.ReadString(cs);
+			format = atoi(cs);
+
+			if (format == 8 || format == 9 || format == 9) {
+				// skip line 2 name, 3 kind
+				csf.ReadString(cs);
+				csf.ReadString(cs);
+
+				// line 4 revision
+				csf.ReadString(cs);
+				revision = atoi(cs);
+			}
+
+			csf.Close();
+		}
+	}
+
+	if (nRetCode == 0) {
+		printf("#define SVNVERSION %d", revision);
+	}
+	else {
+		printf("#undef SVNVERSION");
+	}
+
+	return nRetCode;
+}

Added: trunk/teraterm/svnrev/svnrev.h
===================================================================
--- trunk/teraterm/svnrev/svnrev.h	                        (rev 0)
+++ trunk/teraterm/svnrev/svnrev.h	2009-03-25 15:39:23 UTC (rev 3236)
@@ -0,0 +1 @@
+#pragma once

Added: trunk/teraterm/svnrev/svnrev.vcproj
===================================================================
--- trunk/teraterm/svnrev/svnrev.vcproj	                        (rev 0)
+++ trunk/teraterm/svnrev/svnrev.vcproj	2009-03-25 15:39:23 UTC (rev 3236)
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="svnrev"
+	ProjectGUID="{80F1C3F0-A213-4D48-85C8-A265990D19A7}"
+	RootNamespace="svnrev"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="2"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="2"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="ƒ\[ƒX ƒtƒ@ƒCƒ‹"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\stdafx.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\svnrev.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="ƒwƒbƒ_[ ƒtƒ@ƒCƒ‹"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\stdafx.h"
+				>
+			</File>
+			<File
+				RelativePath=".\svnrev.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: trunk/teraterm/ttermpro.sln
===================================================================
--- trunk/teraterm/ttermpro.sln	2009-03-25 12:54:43 UTC (rev 3235)
+++ trunk/teraterm/ttermpro.sln	2009-03-25 15:39:23 UTC (rev 3236)
@@ -2,12 +2,12 @@
 # Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ttermpro", "teraterm\ttermpro.vcproj", "{BC4CDBE3-6269-47A8-BD74-EEB3A6160E06}"
 	ProjectSection(ProjectDependencies) = postProject
+		{311F2B21-AEC4-4384-8209-BB83B54749B4} = {311F2B21-AEC4-4384-8209-BB83B54749B4}
+		{118E0D32-5553-4F73-9927-E873C1C500E4} = {118E0D32-5553-4F73-9927-E873C1C500E4}
+		{6D08053B-1C68-4A7E-8766-3553F5AF010B} = {6D08053B-1C68-4A7E-8766-3553F5AF010B}
+		{5CF58947-E861-4A5C-B0B1-E85486F149CD} = {5CF58947-E861-4A5C-B0B1-E85486F149CD}
+		{BA519362-A2C2-4B1A-905B-F00791F9038A} = {BA519362-A2C2-4B1A-905B-F00791F9038A}
 		{47CB840D-85C8-460F-9101-BEB54BEF9D56} = {47CB840D-85C8-460F-9101-BEB54BEF9D56}
-		{BA519362-A2C2-4B1A-905B-F00791F9038A} = {BA519362-A2C2-4B1A-905B-F00791F9038A}
-		{5CF58947-E861-4A5C-B0B1-E85486F149CD} = {5CF58947-E861-4A5C-B0B1-E85486F149CD}
-		{6D08053B-1C68-4A7E-8766-3553F5AF010B} = {6D08053B-1C68-4A7E-8766-3553F5AF010B}
-		{118E0D32-5553-4F73-9927-E873C1C500E4} = {118E0D32-5553-4F73-9927-E873C1C500E4}
-		{311F2B21-AEC4-4384-8209-BB83B54749B4} = {311F2B21-AEC4-4384-8209-BB83B54749B4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keycode", "keycode\keycode.vcproj", "{B31BF2E8-79E6-4735-BEA2-C1B4041C2D2E}"
@@ -17,6 +17,7 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ttpdlg", "ttpdlg\ttpdlg.vcproj", "{47CB840D-85C8-460F-9101-BEB54BEF9D56}"
 	ProjectSection(ProjectDependencies) = postProject
 		{118E0D32-5553-4F73-9927-E873C1C500E4} = {118E0D32-5553-4F73-9927-E873C1C500E4}
+		{80F1C3F0-A213-4D48-85C8-A265990D19A7} = {80F1C3F0-A213-4D48-85C8-A265990D19A7}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ttpfile", "ttpfile\ttpfile.vcproj", "{311F2B21-AEC4-4384-8209-BB83B54749B4}"
@@ -36,6 +37,8 @@
 		{118E0D32-5553-4F73-9927-E873C1C500E4} = {118E0D32-5553-4F73-9927-E873C1C500E4}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "svnrev", "svnrev\svnrev.vcproj", "{80F1C3F0-A213-4D48-85C8-A265990D19A7}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -74,6 +77,10 @@
 		{6D08053B-1C68-4A7E-8766-3553F5AF010B}.Debug|Win32.Build.0 = Debug|Win32
 		{6D08053B-1C68-4A7E-8766-3553F5AF010B}.Release|Win32.ActiveCfg = Release|Win32
 		{6D08053B-1C68-4A7E-8766-3553F5AF010B}.Release|Win32.Build.0 = Release|Win32
+		{80F1C3F0-A213-4D48-85C8-A265990D19A7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{80F1C3F0-A213-4D48-85C8-A265990D19A7}.Debug|Win32.Build.0 = Debug|Win32
+		{80F1C3F0-A213-4D48-85C8-A265990D19A7}.Release|Win32.ActiveCfg = Release|Win32
+		{80F1C3F0-A213-4D48-85C8-A265990D19A7}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: trunk/teraterm/ttpdlg/ttpdlg.vcproj
===================================================================
--- trunk/teraterm/ttpdlg/ttpdlg.vcproj	2009-03-25 12:54:43 UTC (rev 3235)
+++ trunk/teraterm/ttpdlg/ttpdlg.vcproj	2009-03-25 15:39:23 UTC (rev 3236)
@@ -25,6 +25,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
+				CommandLine="$(OutDir)\svnrev.exe &gt; $(InputDir)svnversion.h"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -125,6 +126,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
+				CommandLine="$(OutDir)\svnrev.exe &gt; $(InputDir)svnversion.h"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"



Ttssh2-commit メーリングリストの案内
Back to archive index