How can I update the copyright information of files in Xcode? - xcode

I want to change all copyright information of my whole project. For this, I changed the template of the copyright, but this change does not affect my existing project files, only newly created files.
Do you know how can I update all copyright information in a whole project?

I changed the template of the copyright, but this change does not affect my existing project files, only newly created files.
Right. It's like when you bend your cookie cutter into a new shape: you don't expect the cookies you've cut out previously to assume the new shape. ;-)
The templates in Xcode don't retain any association with the files that are created from them: once a file is created, it's just a plain old text file, and the templated fields like your name and the copyright year are just plain text.
Do you know how can I update all copyright information in a whole project?
I assume that we're talking here specifically about the copyright notice in the header comment of each file, like:
//
// FirstViewController.swift
// TestThis
//
// Created by Marcel Gangwisch 11/19/17.
// Copyright © 2017 Marcel Gangwisch. All rights reserved.
//
And you want to update that copyright notice to say 2018, right? Find and replace should do the job here. If you use the Find Navigator in Xcode, you can easily search using patterns, and all the files that match the pattern will be listed in the navigator.
Just to be clear, remember that the copyright notice in your source code comments doesn't affect the final product at all. If you're updating the source code copyright, you'll likely also want to update any copyright notices in the product(s) you're building. That's a little less straightforward because where you display a copyright notice in your app is up to you. But you should still be able to find the relevant files by searching for the © symbol, and of course just looking at the UI in your app will probably help.
If your app is distributed through Apple's App Store, you may need to update the app description and other metadata there. Same goes for your own web site, and also Github or whatever code repository you use.
But I would also like to restore some copyright information - so with the date, when the file was created, which I dont have.. - so I thought xcode can do some magic here
The current Xcode template does include a separate line for creation date, and if your files have that, changing the copyright year shouldn't affect the creation date line. If you need to preserve the existing year, you can again use regular expressions, and this time insert the matched pattern. For example, if you want to add an "Original copyright xxxx" comment line, you could do this:
That adds a line break at the end of the first line, and then adds a second line that re-uses the captured year.

Related

Xamarin Android custom NOTICE file

We are developing an application in Xamarin, using the ZXing.Net.Mobile library. This library states that it is based on ZXing. Both libraries are released under Apache v2.0, which states that:
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
ZXing.Net.Mobile does not have a NOTICE file, however ZXing itself does. This leads me to believe that ZXing.Net.Mobile is actually violating the apache license, as they themselves state that the library is based on ZXing.
This in turn would still make us responsible for putting their NOTICE file contents in our own NOTICE file if present. It turns out that Xamarin actually generates a NOTICE file, containing Xamarin related licensing.
So, the main question is: How can I either append text to the Xamarin generated NOTICE file, or replace it by my own? EmbeddedResource does not seem to work.

Can you disable file header templating for specific projects?

Normally, as part of our development process, want every file to have a standard file header comment section. Here's the default one Xcode creates for reference:
//
// SomeFile.swift
// MyProject
//
// Created by Joe Coder (Joe#JoeCoder.com) on 1/1/18.
// Copyright © 2018 JoeCoder, Inc. All rights reserved.
//
For my 'Day Job', we've set a custom version that includes our legal copyright information and other specific details. However, to my knowledge, this is set at the install-level, not at the project level, meaning even if I'm just spinning up a quick project to test with, or a utility that I'm going to use, all of those details get inserted even though technically they aren't relevant.
Is it possible to configure headers at a project-level to override the one at the installation-level?
Same question for the user info since it has my corporate email which again doesn't always apply.

Insert or replace Copyright Policy in every page on VS-2010

I have more then 1000 pages in my project.In every page of my project I have Copyright Policy.Now terms of policy is change so I must have to open each and every page to paste my policy.Its so boring process and chance to missing some file.Find and replace all in entire solution not help much in this situation.So Is there any built in method in VS2010 to solve my problem ? Or is there any other alternative solution.Thanks.
Old One:
#region "Copyright"
/*
Old Copyright
.........................
*/
#endregion
replace with New one:
#region "Copyright"
/*
New Copyright
....................
*/
#endregion
It shouldn't take long to write another quick program in C# to read in your source files and replace the comment. Or if you're lucky enough to use Resharper, it has a code cleanup feature that can add or update headers in source files.
Although you could, you don't need to write a macro or other text-processing script to do this. Just use the "Find and Replace" feature built into Visual Studio.
You have a specific "old" format that you're replacing, down to the #region "Copyright" and #endregion lines that enclose the block, so this should be rather simple. "Find and Replace" even supports regular expressions.
Only problem is that Visual Studio (at least up to VS 2010, not sure if this changed in 2012) uses its own regex syntax. Jeff Atwood has blogged about this before, and you can find more info here on MSDN.
However…I must say that I agree with Heinzi: it's ugly, annoying, and ultimately quite pointless to repeat legalese in every code file. All you have to do is include it in one file (named e.g. COPYRIGHT or LICENSE) and refer to it in the other files. Makes updating far easier, and prevents noise from cluttering up the code files. More thoughts on this can be found here, very much worth a read: it's both entertaining and true. Don't be a monkey.

Is there a way to force all cs files to include a header comments?

We are using visual studio 2012. Ideally all csharp file (xxx.cs) should include a copy right comment in the header of the file like
#region Copyright GOOGLE 2013
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written consent of the copyright owner.
//
#endregion
My question is, if there is a way to automatically include that comment when we create the file? Or alternatively can use code-analysis to prevent non-comments cs file being checked in.
You can customize the templates Visual Studio uses when you create new files
http://msdn.microsoft.com/en-us/library/ms247119.aspx
Your own custom templates could include the desired copyright notice.
Whether and how automated analysis at check-in can flag such files depends on the source code management system you are using. Many provide pre- and post-checkin hooks.

Joomla Template Editing

I'm using template at this url for my site. In page footer of my site, displays Joomla! is Free Software released under the GNU General Public License. phrase under the Copyright © 2012 MySite. All Rights Reserved. phrase . i need to remove Joomla! is Free Software released under the GNU General Public License. phrase. how can i do it ?
You need to edit your en-GB.mod_footer.ini file. Assuming you have Joomla installed in your site's root directory, the file is located at:
www.YOURSITE.com/language/en-GB/en-GB.mod_footer.ini
Among other things, you'll see some code that looks like this:
FOOTER=Footer
FOOTER_LINE1=Copyright © %date% %sitename%. All Rights Reserved.
FOOTER_LINE2=Joomla! is Free Software released under the GNU/GPL License.
MOD_FOOTER=<em>mod_footer</em>
THIS MODULE SHOWS THE JOOMLA! COPYRIGHT INFORMATION=This module shows the Joomla! copyright information.
Get rid of FOOTER_LINE2, then save the file and re-upload it to the /language/en-GB/ folder.
Good luck!
Cynthia
Starting with Joomla 1.5 and its move to Internationalization and full support of UTF-8, messages for footer.php and other Joomla pages has been moved to a language specific file.
If you want to change the text, go to the language directory, go to the folder of the language you want to change, find the mod_footer.ini file and change the relevant text. For British English, the specific file is language/en-GB/en-GB.mod_footer.ini. Remember that you may not remove copyright and license information from the source code.
If you want to remove the footer entirely, go to Extensions > Module Manager and unpublish the footer module.
Other places where can look for options to make changes are these. If you find code related to footers in these files, you can either "comment it out" or remove it:
/includes/footer.php file.
index.php file for your active template
Source: http://docs.joomla.org/Can_you_remove_the_%22Powered_by_Joomla!%22_message%3F
You can also edit the following for the Admin page, <InstallationFolder>/administrator/language/en-GB/en-GB.ini line 332:
JGLOBAL_ISFREESOFTWARE="%s is free software released under the GNU General Public License."

Resources