From 49614eacd96c23b05608b4a9599cfb1758078348 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 24 Apr 2024 12:33:07 +0200 Subject: [PATCH 1/4] With two swift files one must be main.swift --- 1_single_executable/CMakeLists.txt | 2 +- 1_single_executable/{hello.swift => main.swift} | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename 1_single_executable/{hello.swift => main.swift} (93%) diff --git a/1_single_executable/CMakeLists.txt b/1_single_executable/CMakeLists.txt index 05d4d5d..08d9393 100644 --- a/1_single_executable/CMakeLists.txt +++ b/1_single_executable/CMakeLists.txt @@ -9,4 +9,4 @@ cmake_minimum_required(VERSION 3.22) project(hello LANGUAGES Swift) -add_executable(hello hello.swift) +add_executable(hello main.swift world.swift) diff --git a/1_single_executable/hello.swift b/1_single_executable/main.swift similarity index 93% rename from 1_single_executable/hello.swift rename to 1_single_executable/main.swift index 921f562..bd8e482 100644 --- a/1_single_executable/hello.swift +++ b/1_single_executable/main.swift @@ -9,4 +9,5 @@ // //===----------------------------------------------------------------------===// -print("Hello, world!") + +print("Hello, \(world())") From 3a944662b72c832da821a199d6b73bb6dbfbf223 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 26 Apr 2024 11:39:31 +0200 Subject: [PATCH 2/4] Add world.swift --- 1_single_executable/world.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 1_single_executable/world.swift diff --git a/1_single_executable/world.swift b/1_single_executable/world.swift new file mode 100644 index 0000000..5a4ba2e --- /dev/null +++ b/1_single_executable/world.swift @@ -0,0 +1,16 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift open source project +// +// Copyright (c) 2023 Apple Inc. and the Swift project authors. +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// +//===----------------------------------------------------------------------===// + +func world() -> String +{ + return "world" +} + From 860e103c30775ce500149f1c8e1cad6c6f0d674c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 3 May 2024 13:47:44 +0200 Subject: [PATCH 3/4] Update 1_single_executable/main.swift Co-authored-by: Laurent Rineau --- 1_single_executable/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1_single_executable/main.swift b/1_single_executable/main.swift index bd8e482..ea5c6f2 100644 --- a/1_single_executable/main.swift +++ b/1_single_executable/main.swift @@ -10,4 +10,4 @@ //===----------------------------------------------------------------------===// -print("Hello, \(world())") +print("Hello, \(world())!") From c2332d3313e2f948dab8a34ad00ef66b8e5f5d08 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 3 May 2024 13:47:57 +0200 Subject: [PATCH 4/4] Update 1_single_executable/world.swift Co-authored-by: Laurent Rineau --- 1_single_executable/world.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1_single_executable/world.swift b/1_single_executable/world.swift index 5a4ba2e..57641f4 100644 --- a/1_single_executable/world.swift +++ b/1_single_executable/world.swift @@ -11,6 +11,6 @@ func world() -> String { - return "world" + return "world" }